# HG changeset patch # User cin # Date 1408864495 -14400 # Node ID 5bca2d201ad87729ec5d88c8a156f3f2633f4fa9 initial commit diff -r 000000000000 -r 5bca2d201ad8 README.markdown --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.markdown Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,7 @@ +RazorEngine +=========== + +A templating engine built on Microsoft's Razor parsing engine, RazorEngine allows you to use Razor syntax to build dynamic templates: + + string template = "Hello @Model.Name, welcome to RazorEngine!"; + string result = Razor.Parse(template, new { Name = "World" }); \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/AttributeValue.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/AttributeValue.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,38 @@ +namespace RazorEngine +{ + using System; + + public class AttributeValue + { + public AttributeValue(PositionTagged prefix, PositionTagged value, bool literal) + { + Prefix = prefix; + Value = value; + Literal = literal; + } + + public PositionTagged Prefix { get; private set; } + public PositionTagged Value { get; private set; } + public bool Literal { get; private set; } + + public static AttributeValue FromTuple(Tuple, Tuple, bool> value) + { + return new AttributeValue(value.Item1, value.Item2, value.Item3); + } + + public static AttributeValue FromTuple(Tuple, Tuple, bool> value) + { + return new AttributeValue(value.Item1, new PositionTagged(value.Item2.Item1, value.Item2.Item2), value.Item3); + } + + public static implicit operator AttributeValue(Tuple, Tuple, bool> value) + { + return FromTuple(value); + } + + public static implicit operator AttributeValue(Tuple, Tuple, bool> value) + { + return FromTuple(value); + } + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/ClassDiagram.cd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/ClassDiagram.cd Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,395 @@ + + + + + + AAAAAAAABCAAAAAAAAEgAAAAQAAgCMAAAAAAAAAAAQA= + Compilation\CompilerServiceBase.cs + + + + + + + AAAAAAAAAIAAAAIAEAAAAAQAAAAAAAAAAAACAAAAAAA= + Compilation\CompilerServiceBuilder.cs + + + + + + AAAAAAAAAAAAAAJBAAAABAAAAAAAAAAAAAAIAAAEBAA= + Compilation\CompilerServicesUtility.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAA= + Compilation\DefaultCompilerServiceFactory.cs + + + + + + + QAIAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEA= + Compilation\DirectCompilerServiceBase.cs + + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Compilation\HasDynamicModelAttribute.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAgAAAAAAAA= + Compilation\RazorDynamicObject.cs + + + + + + AAAAAAEAAACEAAAAABAAAAAAAAAAAAAAAAIAAAAAAAA= + Compilation\TypeContext.cs + + + + + + AAAAAAAAAAAAAAAAAAAgAAAAQAAAAAAAAAAAAAAAAAA= + Compilation\CSharp\CSharpDirectCompilerService.cs + + + + + + AAAAAQAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAA= + Compilation\CSharp\CSharpRazorCodeGenerator.cs + + + + + + AAAAAQAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Compilation\CSharp\CSharpRazorCodeLanguage.cs + + + + + + AAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAA= + Compilation\VisualBasic\VBDirectCompilerService.cs + + + + + + AAAAAQAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAA= + Compilation\VisualBasic\VBRazorCodeGenerator.cs + + + + + + AAAAAQAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Compilation\VisualBasic\VBRazorCodeLanguage.cs + + + + + + AAAAAAEACAAAAAAIAAAAAEAAEAAAAAAAAAAAAAAAAAA= + Configuration\DefaultTemplateServiceConfiguration.cs + + + + + + + gAAIARAAAAAAAAQAAAAAAAEBAgAAAQAAAAAACAAAAAA= + Configuration\Fluent\FluentConfigurationBuilder.cs + + + + + + + AAAAAAEACAAAAAAIAAAAAFAAEAAAAAAAAAAAAAAAAAA= + Configuration\Fluent\FluentTemplateServiceConfiguration.cs + + + + + + + ACAAAAAAAAAAAAAAAAAIBAAAAAABAABAgCAAAAABAAA= + Configuration\RazorEngineConfigurationSection.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAIAAAAAAAA= + Templating\CachedTemplateItem.cs + + + + + + AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Templating\DefaultActivator.cs + + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAA= + Templating\DefaultAppDomainFactory.cs + + + + + + + AAAABAAAAAQAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAA= + Templating\DelegateActivator.cs + + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAA= + Templating\DelegateAppDomainFactory.cs + + + + + + + AAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAA= + Templating\InstanceContext.cs + + + + + + AAIkAAAAACAAAAQAAAAAAAQEAAAEAgAAAEAYAAARAAA= + Templating\IsolatedTemplateService.cs + + + + + + + AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Templating\RequireNamespacesAttribute.cs + + + + + + AIAAAAAAAAABCAQAAAAAAAwAAAAAAAAgCAAAAAGACAA= + Templating\TemplateBase.cs + + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAIAAI= + Templating\TemplateBaseOfT.cs + + + + + + + AAAAAAAAAAAAAQAAAAAAAAAgAAAAAAAAAAAAAAAAAAA= + Templating\TemplateCompilationException.cs + + + + + + AAAAAAAAAAAAAAAAAABAAAAgAAAAAAAAAAAAAAABAAA= + Templating\TemplateParsingException.cs + + + + + + EIIoAAgACKAAAAQIAAAAAAQAQAAEAgAAAEAkAAABAAA= + Templating\TemplateService.cs + + + + + + + AAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAgAAAAAAAAAA= + Templating\TemplateServiceFactory.cs + + + + + + AAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Templating\TemplateWriter.cs + + + + + + EAIEBAAQACABAAAAAAAQBAABAAAAAAAAAAAAAAAAAAA= + Templating\TypeLoader.cs + + + + + + + AAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAA= + Templating\Parallel\DefaultParallelQueryPlan.cs + + + + + + + EAAAAACAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Text\HtmlEncodedString.cs + + + + + + + AAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Text\HtmlEncodedStringFactory.cs + + + + + + + AAAAAACAAAAAAAAEAAAAAAAAAAAAAAAAAAQAAAAAAAA= + Text\RawString.cs + + + + + + + AAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Text\RawStringFactory.cs + + + + + + + AAAAAAAABCAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAA= + Compilation\ICompilerService.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAA= + Compilation\ICompilerServiceFactory.cs + + + + + + gAAAARAAAAAAAAQAAAAAAAEBAgAAAQAAAAAACAAAAAA= + Configuration\Fluent\IConfigurationBuilder.cs + + + + + + AAAAAAEACAAAAAAIAAAAAEAAEAAAAAAAAAAAAAAAAAA= + Configuration\ITemplateServiceConfiguration.cs + + + + + + AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Templating\IActivator.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAA= + Templating\IAppDomainFactory.cs + + + + + + AAAAAAAAAAABAAQAAAAAAAQAAAAAAAAAAAAAAAGAAAI= + Templating\ITemplate.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAA= + Templating\ITemplateOfT.cs + + + + + + AAAgAAAAAAAAAAQIAAAAAAQAAAAEAgAAAEAAAAABAAA= + Templating\ITemplateService.cs + + + + + + AAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAA= + Templating\Parallel\IParallelQueryPlan.cs + + + + + + AAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Text\IEncodedString.cs + + + + + + AAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + Text\IEncodedStringFactory.cs + + + + + + AAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAA= + Encoding.cs + + + + + + AAAACAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAA= + Language.cs + + + + \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/CodeGenerators/SetModelTypeCodeGenerator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/CodeGenerators/SetModelTypeCodeGenerator.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,48 @@ +namespace RazorEngine.CodeGenerators +{ + using System; + using System.Globalization; + using System.Web.Razor.Generator; + using Common; + + internal class SetModelTypeCodeGenerator : SetBaseTypeCodeGenerator + { + private readonly string _genericTypeFormat; + + public SetModelTypeCodeGenerator(string modelType, string genericTypeFormat) + : base(modelType) + { + _genericTypeFormat = genericTypeFormat; + } + + protected override string ResolveType(CodeGeneratorContext context, string baseType) + { + return String.Format( + CultureInfo.InvariantCulture, + _genericTypeFormat, + context.Host.DefaultBaseClass, + baseType); + } + + public override bool Equals(object obj) + { + SetModelTypeCodeGenerator other = obj as SetModelTypeCodeGenerator; + return other != null && + base.Equals(obj) && + String.Equals(_genericTypeFormat, other._genericTypeFormat, StringComparison.Ordinal); + } + + public override int GetHashCode() + { + return HashCodeCombiner.Start() + .Add(base.GetHashCode()) + .Add(_genericTypeFormat) + .CombinedHash; + } + + public override string ToString() + { + return "Model:" + BaseType; + } + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Common/GlobalSuppressions.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Common/GlobalSuppressions.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,23 @@ +// This file is used by Code Analysis to maintain SuppressMessage +// attributes that are applied to this project. +// Project-level suppressions either have no target or are given +// a specific target and scoped to a namespace, type, member, etc. +// +// To add a suppression to this file, right-click the message in the +// Error List, point to "Suppress Message(s)", and click +// "In Project Suppression File". +// You do not need to add suppressions to this file manually. + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "RazorEngine.Compilation.CSharp")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "RazorEngine.Compilation.VisualBasic")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Templating", Scope = "namespace", Target = "RazorEngine.Templating")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1014:MarkAssembliesWithClsCompliant")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Scope = "member", Target = "RazorEngine.Compilation.CSharp.CSharpDirectCompilerService.#.ctor(System.Boolean,System.Web.Razor.Parser.MarkupParser)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Scope = "member", Target = "RazorEngine.Compilation.VisualBasic.VBDirectCompilerService.#.ctor(System.Boolean,System.Web.Razor.Parser.MarkupParser)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Scope = "member", Target = "RazorEngine.Templating.IsolatedTemplateService.#.ctor(RazorEngine.Compilation.ICompilerService,RazorEngine.Templating.IActivator)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Scope = "member", Target = "RazorEngine.Templating.TemplateService.#.ctor(RazorEngine.Compilation.ICompilerService,RazorEngine.Templating.IActivator)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "RazorEngine")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "RazorEngine.Compilation.Inspectors")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "RazorEngine.Spans")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "RazorEngine.Templating.Parallel")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Templating", Scope = "namespace", Target = "RazorEngine.Templating.Parallel")] diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Common/HashCodeCombiner.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Common/HashCodeCombiner.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,51 @@ +using System.Collections; + +namespace RazorEngine.Common +{ + internal class HashCodeCombiner + { + private long _combinedHash64 = 0x1505L; + + public int CombinedHash + { + get { return _combinedHash64.GetHashCode(); } + } + + public HashCodeCombiner Add(IEnumerable e) + { + if (e == null) + { + Add(0); + } + else + { + int count = 0; + foreach (object o in e) + { + Add(o); + count++; + } + Add(count); + } + return this; + } + + public HashCodeCombiner Add(int i) + { + _combinedHash64 = ((_combinedHash64 << 5) + _combinedHash64) ^ i; + return this; + } + + public HashCodeCombiner Add(object o) + { + int hashCode = (o != null) ? o.GetHashCode() : 0; + Add(hashCode); + return this; + } + + public static HashCodeCombiner Start() + { + return new HashCodeCombiner(); + } + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/CSharp/CSharpCodeParser.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/CSharp/CSharpCodeParser.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,81 @@ +namespace RazorEngine.Compilation.CSharp +{ + using System.Web.Razor.Generator; + using System.Web.Razor.Text; + using System.Web.Razor.Parser; + using CodeGenerators; + + /// + /// Defines a code parser that supports the C# syntax. + /// + public class CSharpCodeParser : System.Web.Razor.Parser.CSharpCodeParser + { + #region Fields + private const string GenericTypeFormatString = "{0}<{1}>"; + private SourceLocation? _endInheritsLocation; + private bool _modelStatementFound; + #endregion + + #region Constructor + /// + /// Initialises a new instance of . + /// + public CSharpCodeParser() + { + MapDirectives(ModelDirective, "model"); + } + #endregion + + #region Methods + /// + /// Parses the inherits statement. + /// + protected override void InheritsDirective() + { + // Verify we're on the right keyword and accept + AssertDirective(SyntaxConstants.CSharp.InheritsKeyword); + AcceptAndMoveNext(); + _endInheritsLocation = CurrentLocation; + + InheritsDirectiveCore(); + CheckForInheritsAndModelStatements(); + } + + private void CheckForInheritsAndModelStatements() + { + if (_modelStatementFound && _endInheritsLocation.HasValue) + { + Context.OnError(_endInheritsLocation.Value, "The 'inherits' keyword is not allowed when a 'model' keyword is used."); + } + } + + /// + /// Parses the model statement. + /// + protected virtual void ModelDirective() + { + // Verify we're on the right keyword and accept + AssertDirective("model"); + AcceptAndMoveNext(); + + SourceLocation endModelLocation = CurrentLocation; + + BaseTypeDirective("The 'model' keyword must be followed by a type name on the same line.", CreateModelCodeGenerator); + + if (_modelStatementFound) + { + Context.OnError(endModelLocation, "Only one 'model' statement is allowed in a file."); + } + + _modelStatementFound = true; + + CheckForInheritsAndModelStatements(); + } + + private SpanCodeGenerator CreateModelCodeGenerator(string model) + { + return new SetModelTypeCodeGenerator(model, GenericTypeFormatString); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/CSharp/CSharpDirectCompilerService.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/CSharp/CSharpDirectCompilerService.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,43 @@ +namespace RazorEngine.Compilation.CSharp +{ + using System; + using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; + using System.Linq; + using System.Web.Razor.Parser; + + using Microsoft.CSharp; + using Microsoft.CSharp.RuntimeBinder; + + /// + /// Defines a direct compiler service for the C# syntax. + /// + public class CSharpDirectCompilerService : DirectCompilerServiceBase + { + #region Constructor + /// + /// Initialises a new instance of . + /// + /// Specifies whether the strict mode parsing is enabled. + /// The markup parser factory to use. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed"), SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "Disposed in base class: DirectCompilerServiceBase")] + public CSharpDirectCompilerService(bool strictMode = true, Func markupParserFactory = null) + : base( + new CSharpRazorCodeLanguage(strictMode), + new CSharpCodeProvider(), + markupParserFactory) { } + #endregion + + #region Methods + /// + /// Returns a set of assemblies that must be referenced by the compiled template. + /// + /// The set of assemblies. + public override IEnumerable IncludeAssemblies() + { + // Ensure the Microsoft.CSharp assembly is referenced to support dynamic typing. + return new[] { typeof(Binder).Assembly.Location }; + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/CSharp/CSharpRazorCodeGenerator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/CSharp/CSharpRazorCodeGenerator.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,78 @@ +using System; +using System.Linq; + +namespace RazorEngine.Compilation.CSharp +{ + using System.CodeDom; + using System.Web.Razor; + using System.Web.Razor.Parser.SyntaxTree; + + using Templating; + + /// + /// Defines a code generator that supports C# syntax. + /// + public class CSharpRazorCodeGenerator : System.Web.Razor.Generator.CSharpRazorCodeGenerator + { + #region Constructor + /// + /// Initializes a new instance of the class. + /// + /// Name of the class. + /// Name of the root namespace. + /// Name of the source file. + /// The host. + /// Flag to specify that this generator is running in struct mode. + public CSharpRazorCodeGenerator(string className, string rootNamespaceName, string sourceFileName, RazorEngineHost host, bool strictMode) + : base(className, rootNamespaceName, sourceFileName, host) + { + StrictMode = strictMode; + var mvcHost = host as Compilation.RazorEngineHost; + if (mvcHost != null) + { + SetBaseTypeFromHost(mvcHost); + } + } + + private void SetBaseTypeFromHost(Compilation.RazorEngineHost mvcHost) + { + if (!mvcHost.DefaultBaseTemplateType.IsGenericType) + { + SetBaseType(mvcHost.DefaultBaseTemplateType.FullName); + } + else + { + var modelTypeName = CompilerServicesUtility.ResolveCSharpTypeName(mvcHost.DefaultModelType); + SetBaseType(mvcHost.DefaultBaseClass + "<" + modelTypeName + ">"); + } + } + + #endregion + + #region Properties + /// + /// Gets whether the code generator is running in strict mode. + /// + public bool StrictMode { get; private set; } + #endregion + + #region Methods + private void SetBaseType(string baseTypeName) + { + var baseType = new CodeTypeReference(baseTypeName); + Context.GeneratedClass.BaseTypes.Clear(); + Context.GeneratedClass.BaseTypes.Add(baseType); + } + + /// + /// Visits an error generated through parsing. + /// + /// The error that was generated. + public override void VisitError(RazorError err) + { + if (StrictMode) + throw new TemplateParsingException(err); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/CSharp/CSharpRazorCodeLanguage.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/CSharp/CSharpRazorCodeLanguage.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,44 @@ +namespace RazorEngine.Compilation.CSharp +{ + using System.Web.Razor; + using System.Web.Razor.Generator; + + /// + /// Provides a razor code language that supports the C# language. + /// + public class CSharpRazorCodeLanguage : System.Web.Razor.CSharpRazorCodeLanguage + { + #region Constructor + /// + /// Initialises a new instance + /// + /// Flag to determine whether strict mode is enabled. + public CSharpRazorCodeLanguage(bool strictMode) + { + StrictMode = strictMode; + } + #endregion + + #region Properties + /// + /// Gets whether strict mode is enabled. + /// + public bool StrictMode { get; private set; } + #endregion + + #region Methods + /// + /// Creates the code generator. + /// + /// Name of the class. + /// Name of the root namespace. + /// Name of the source file. + /// The host. + /// An instance of . + public override RazorCodeGenerator CreateCodeGenerator(string className, string rootNamespaceName, string sourceFileName, RazorEngineHost host) + { + return new CSharpRazorCodeGenerator(className, rootNamespaceName, sourceFileName, host, StrictMode); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/CompilerServiceBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/CompilerServiceBase.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,248 @@ +namespace RazorEngine.Compilation +{ + using System; + using System.CodeDom; + using System.Collections.Generic; + using System.Diagnostics.Contracts; + using System.IO; + using System.Linq; + using System.Reflection; + using System.Web.Razor; + using System.Web.Razor.Generator; + using System.Web.Razor.Parser; + + using Inspectors; + using Templating; + + /// + /// Provides a base implementation of a compiler service. + /// + public abstract class CompilerServiceBase : MarshalByRefObject, ICompilerService + { + #region Constructor + /// + /// Initialises a new instance of + /// + /// The code language. + /// The markup parser factory. + protected CompilerServiceBase(RazorCodeLanguage codeLanguage, Func markupParserFactory) + { + Contract.Requires(codeLanguage != null); + + CodeLanguage = codeLanguage; + MarkupParserFactory = markupParserFactory ?? (() => new HtmlMarkupParser()); + } + #endregion + + #region Properties + /// + /// Gets or sets the set of code inspectors. + /// + public IEnumerable CodeInspectors { get; set; } + + /// + /// Gets the code language. + /// + public RazorCodeLanguage CodeLanguage { get; private set; } + + /// + /// Gets or sets whether the compiler service is operating in debug mode. + /// + public bool Debug { get; set; } + + /// + /// Gets the markup parser. + /// + public Func MarkupParserFactory { get; private set; } + #endregion + + #region Methods + + /// + /// Builds a type name for the specified template type. + /// + /// The template type. + /// The string type name (including namespace). + [Pure] + public virtual string BuildTypeName(Type templateType) + { + if (templateType == null) + throw new ArgumentNullException("templateType"); + + if (!templateType.IsGenericTypeDefinition || !templateType.IsGenericType) + return templateType.FullName; + + return templateType.Namespace + + "." + + templateType.Name.Substring(0, templateType.Name.IndexOf('`')); + } + + /// + /// Compiles the type defined in the specified type context. + /// + /// The type context which defines the type to compile. + /// The compiled type. + public abstract Tuple CompileType(TypeContext context); + + /// + /// Creates a used for class generation. + /// + /// The template base type. + /// The model type. + /// The class name. + /// An instance of . + private RazorEngineHost CreateHost(Type templateType, Type modelType, string className) + { + var host = new RazorEngineHost(CodeLanguage, MarkupParserFactory) + { + DefaultBaseTemplateType = templateType, + DefaultModelType = modelType, + DefaultBaseClass = BuildTypeName(templateType), + DefaultClassName = className, + DefaultNamespace = "CompiledRazorTemplates.Dynamic", + GeneratedClassContext = new GeneratedClassContext("Execute", "Write", "WriteLiteral", + "WriteTo", "WriteLiteralTo", + "RazorEngine.Templating.TemplateWriter", + "DefineSection") { + ResolveUrlMethodName = "ResolveUrl" + } + }; + + return host; + } + + /// + /// Generates any required contructors for the specified type. + /// + /// The set of constructors. + /// The code type declaration. + [Pure] + private static void GenerateConstructors(IEnumerable constructors, CodeTypeDeclaration codeType) + { + if (constructors == null || !constructors.Any()) + return; + + var existingConstructors = codeType.Members.OfType().ToArray(); + foreach (var existingConstructor in existingConstructors) + codeType.Members.Remove(existingConstructor); + + foreach (var constructor in constructors) + { + var ctor = new CodeConstructor(); + ctor.Attributes = MemberAttributes.Public; + + foreach (var param in constructor.GetParameters()) + { + ctor.Parameters.Add(new CodeParameterDeclarationExpression(param.ParameterType, param.Name)); + ctor.BaseConstructorArgs.Add(new CodeSnippetExpression(param.Name)); + } + + codeType.Members.Add(ctor); + } + } + + /// + /// Gets the code compile unit used to compile a type. + /// + /// The class name. + /// The template to compile. + /// The set of namespace imports. + /// The template type. + /// The model type. + /// A used to compile a type. + [Pure] + public CodeCompileUnit GetCodeCompileUnit(string className, string template, ISet namespaceImports, Type templateType, Type modelType) + { + if (string.IsNullOrEmpty(className)) + throw new ArgumentException("Class name is required."); + + if (string.IsNullOrEmpty(template)) + throw new ArgumentException("Template is required."); + + namespaceImports = namespaceImports ?? new HashSet(); + templateType = templateType ?? ((modelType == null) ? typeof(TemplateBase) : typeof(TemplateBase<>)); + + // Create the RazorEngineHost + var host = CreateHost(templateType, modelType, className); + + // Add any required namespace imports + foreach (string ns in GetNamespaces(templateType, namespaceImports)) + host.NamespaceImports.Add(ns); + + // Gets the generator result. + GeneratorResults result = GetGeneratorResult(host, template); + + // Add the dynamic model attribute if the type is an anonymous type. + var type = result.GeneratedCode.Namespaces[0].Types[0]; + if (modelType != null && CompilerServicesUtility.IsAnonymousType(modelType)) + type.CustomAttributes.Add(new CodeAttributeDeclaration(new CodeTypeReference(typeof(HasDynamicModelAttribute)))); + + // Generate any constructors required by the base template type. + GenerateConstructors(CompilerServicesUtility.GetConstructors(templateType), type); + + // Despatch any inspectors + Inspect(result.GeneratedCode); + + return result.GeneratedCode; + } + + /// + /// Gets the generator result. + /// + /// The razor engine host. + /// The template. + /// The generator result. + private static GeneratorResults GetGeneratorResult(RazorEngineHost host, string template) + { + var engine = new RazorTemplateEngine(host); + GeneratorResults result; + using (var reader = new StringReader(template)) + result = engine.GenerateCode(reader); + + return result; + } + + /// + /// Gets any required namespace imports. + /// + /// The template type. + /// The requested set of namespace imports. + /// A set of namespace imports. + private static IEnumerable GetNamespaces(Type templateType, IEnumerable otherNamespaces) + { + var templateNamespaces = templateType.GetCustomAttributes(typeof(RequireNamespacesAttribute), true) + .Cast() + .SelectMany(a => a.Namespaces) + .Concat(otherNamespaces) + .Distinct(); + + return templateNamespaces; + } + + /// + /// Returns a set of assemblies that must be referenced by the compiled template. + /// + /// The set of assemblies. + public virtual IEnumerable IncludeAssemblies() + { + return Enumerable.Empty(); + } + + /// + /// Inspects the generated code compile unit. + /// + /// The code compile unit. + protected virtual void Inspect(CodeCompileUnit unit) + { + Contract.Requires(unit != null); + + var ns = unit.Namespaces[0]; + var type = ns.Types[0]; + var executeMethod = type.Members.OfType().Where(m => m.Name.Equals("Execute")).Single(); + + foreach (var inspector in CodeInspectors) + inspector.Inspect(unit, ns, type, executeMethod); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/CompilerServiceBuilder.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/CompilerServiceBuilder.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,60 @@ +namespace RazorEngine.Compilation +{ + using System.Diagnostics.Contracts; + + using Configuration; + + /// + /// Manages creation of instances. + /// + public static class CompilerServiceBuilder + { + #region Fields + private static ICompilerServiceFactory _factory = new DefaultCompilerServiceFactory(); + private static readonly object sync = new object(); + #endregion + + #region Methods + /// + /// Sets the used to create compiler service instances. + /// + /// The compiler service factory to use. + public static void SetCompilerServiceFactory(ICompilerServiceFactory factory) + { + Contract.Requires(factory != null); + + lock (sync) + { + _factory = factory; + } + } + + /// + /// Gets the for the specfied language. + /// + /// The code language. + /// The compiler service instance. + public static ICompilerService GetCompilerService(Language language) + { + lock (sync) + { + return _factory.CreateCompilerService(language); + } + } + + /// + /// Gets the for the default . + /// + /// The compiler service instance. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] + public static ICompilerService GetDefaultCompilerService() + { + var config = RazorEngineConfigurationSection.GetConfiguration(); + if (config == null) + return GetCompilerService(Language.CSharp); + + return GetCompilerService(config.DefaultLanguage); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/CompilerServicesUtility.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/CompilerServicesUtility.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,169 @@ +using System.Linq; + +namespace RazorEngine.Compilation +{ + using System; + using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; + using System.Dynamic; + using System.Reflection; + using System.Runtime.CompilerServices; + using System.Text.RegularExpressions; + using System.Collections; + + /// + /// Provides service methods for compilation. + /// + public static class CompilerServicesUtility + { + #region Fields + private static readonly Type DynamicType = typeof(DynamicObject); + private static readonly Type ExpandoType = typeof(ExpandoObject); + private static readonly Type EnumerableType = typeof(IEnumerable); + private static readonly Type EnumeratorType = typeof(IEnumerator); + #endregion + + #region Methods + /// + /// Determines if the specified type is an anonymous type. + /// + /// The type to check. + /// True if the type is an anonymous type, otherwise false. + public static bool IsAnonymousType(Type type) + { + if (type == null) + throw new ArgumentNullException("type"); + + return (type.IsClass + && type.IsSealed + && type.BaseType == typeof(object) + && type.Name.StartsWith("<>", StringComparison.Ordinal) + && type.IsDefined(typeof(CompilerGeneratedAttribute), true)); + } + + /// + /// Determines if the specified type is a dynamic type. + /// + /// The type to check. + /// True if the type is an anonymous type, otherwise false. + public static bool IsDynamicType(Type type) + { + if (type == null) + throw new ArgumentNullException("type"); + + return (DynamicType.IsAssignableFrom(type) + || ExpandoType.IsAssignableFrom(type) + || IsAnonymousType(type)); + } + + /// + /// Determines if the specified type is a compiler generated iterator type. + /// + /// The type to check. + /// True if the type is an iterator type, otherwise false. + public static bool IsIteratorType(Type type) + { + if (type == null) + throw new ArgumentNullException("type"); + + return type.IsNestedPrivate + && type.Name.StartsWith("<", StringComparison.Ordinal) + && (EnumerableType.IsAssignableFrom(type) || EnumeratorType.IsAssignableFrom(type)); + } + + /// + /// Generates a random class name. + /// + /// A new random class name. + public static string GenerateClassName() + { + Guid guid = Guid.NewGuid(); + return Regex.Replace(guid.ToString("N"), @"[^A-Za-z]*", ""); + } + + /// + /// Gets the public or protected constructors of the specified type. + /// + /// The target type. + /// An enumerable of constructors. + public static IEnumerable GetConstructors(Type type) + { + if (type == null) + throw new ArgumentNullException("type"); + + var constructors = type + .GetConstructors(BindingFlags.Public | BindingFlags.Instance); + + return constructors; + } + + public static string ResolveCSharpTypeName(Type type) + { + if (IsIteratorType(type)) + type = GetFirstGenericInterface(type); + + if (IsDynamicType(type)) + return "dynamic"; + + if (!type.IsGenericType) + return type.FullName; + + return type.Namespace + + "." + + type.Name.Substring(0, type.Name.IndexOf('`')) + + "<" + + string.Join(", ", type.GetGenericArguments().Select(ResolveCSharpTypeName)) + + ">"; + } + + public static string ResolveVBTypeName(Type type) + { + if (IsIteratorType(type)) + type = GetFirstGenericInterface(type); + + if (IsDynamicType(type)) + return "Object"; + + if (!type.IsGenericType) + return type.FullName; + + return type.Namespace + + "." + + type.Name.Substring(0, type.Name.IndexOf('`')) + + "(Of" + + string.Join(", ", type.GetGenericArguments().Select(ResolveVBTypeName)) + + ")"; + } + + /// + /// Gets the first generic interface of the specified type if one exists. + /// + /// The target type. + /// The first generic interface if one exists, otherwise the first interface or the target type itself if there are no interfaces. + public static Type GetFirstGenericInterface(Type type) + { + Type firstInterface = null; + foreach (var @interface in type.GetInterfaces()) + { + if (firstInterface == null) + firstInterface = @interface; + + if (@interface.IsGenericType) + return @interface; + } + return @firstInterface ?? type; + } + + /// + /// Gets an enumerable of all assemblies loaded in the current domain. + /// + /// An enumerable of loaded assemblies. + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] + public static IEnumerable GetLoadedAssemblies() + { + var domain = AppDomain.CurrentDomain; + return domain.GetAssemblies(); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/DefaultCompilerServiceFactory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/DefaultCompilerServiceFactory.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,37 @@ +namespace RazorEngine.Compilation +{ + using System; + using System.Diagnostics.CodeAnalysis; + + using CSharp; + using VisualBasic; + + /// + /// Provides a default implementation of a . + /// + public class DefaultCompilerServiceFactory : ICompilerServiceFactory + { + #region Methods + /// + /// Creates a that supports the specified language. + /// + /// The . + /// An instance of . + [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] + public ICompilerService CreateCompilerService(Language language) + { + switch (language) + { + case Language.CSharp: + return new CSharpDirectCompilerService(); + + case Language.VisualBasic: + return new VBDirectCompilerService(); + + default: + throw new ArgumentException("Unsupported language: " + language); + } + } + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/DirectCompilerServiceBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/DirectCompilerServiceBase.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,136 @@ +namespace RazorEngine.Compilation +{ + using System; + using System.CodeDom.Compiler; + using System.Diagnostics.Contracts; + using System.Globalization; + using System.IO; + using System.Linq; + using System.Reflection; + using System.Security; + using System.Text; + using System.Web.Razor; + using System.Web.Razor.Parser; + + using Templating; + + /// + /// Provides a base implementation of a direct compiler service. + /// + public abstract class DirectCompilerServiceBase : CompilerServiceBase, IDisposable + { + #region Fields + private readonly CodeDomProvider _codeDomProvider; + private bool _disposed; + #endregion + + #region Constructor + /// + /// Initialises a new instance of . + /// + /// The razor code language. + /// The code dom provider used to generate code. + /// The markup parser factory. + protected DirectCompilerServiceBase(RazorCodeLanguage codeLanguage, CodeDomProvider codeDomProvider, Func markupParserFactory) + : base(codeLanguage, markupParserFactory) + { + _codeDomProvider = codeDomProvider; + } + #endregion + + #region Methods + /// + /// Creates the compile results for the specified . + /// + /// The type context. + /// The compiler results. + [Pure] + private Tuple Compile(TypeContext context) + { + if (_disposed) + throw new ObjectDisposedException(GetType().Name); + + var compileUnit = GetCodeCompileUnit(context.ClassName, context.TemplateContent, context.Namespaces, + context.TemplateType, context.ModelType); + + var @params = new CompilerParameters + { + GenerateInMemory = true, + GenerateExecutable = false, + IncludeDebugInformation = false, + CompilerOptions = "/target:library /optimize /define:RAZORENGINE" + }; + + var assemblies = CompilerServicesUtility + .GetLoadedAssemblies() + .Where(a => !a.IsDynamic && File.Exists(a.Location)) + .GroupBy(a => a.GetName().Name).Select(grp => grp.First(y => y.GetName().Version == grp.Max(x => x.GetName().Version))) // only select distinct assemblies based on FullName to avoid loading duplicate assemblies + .Select(a => a.Location); + + var includeAssemblies = (IncludeAssemblies() ?? Enumerable.Empty()); + assemblies = assemblies.Concat(includeAssemblies) + .Where(a => !string.IsNullOrWhiteSpace(a)) + .Distinct(StringComparer.InvariantCultureIgnoreCase); + + @params.ReferencedAssemblies.AddRange(assemblies.ToArray()); + + string sourceCode = null; + if (Debug) + { + var builder = new StringBuilder(); + using (var writer = new StringWriter(builder, CultureInfo.InvariantCulture)) + { + _codeDomProvider.GenerateCodeFromCompileUnit(compileUnit, writer, new CodeGeneratorOptions()); + sourceCode = builder.ToString(); + } + } + + return Tuple.Create(_codeDomProvider.CompileAssemblyFromDom(@params, compileUnit), sourceCode); + } + + /// + /// Compiles the type defined in the specified type context. + /// + /// The type context which defines the type to compile. + /// The compiled type. + [Pure, SecurityCritical] + public override Tuple CompileType(TypeContext context) + { + if (context == null) + throw new ArgumentNullException("context"); + + var result = Compile(context); + var compileResult = result.Item1; + + if (compileResult.Errors != null && compileResult.Errors.HasErrors) + throw new TemplateCompilationException(compileResult.Errors, result.Item2, context.TemplateContent); + + return Tuple.Create( + compileResult.CompiledAssembly.GetType("CompiledRazorTemplates.Dynamic." + context.ClassName), + compileResult.CompiledAssembly); + } + + /// + /// Releases managed resourced used by this instance. + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + /// Releases managed resources used by this instance. + /// + /// Are we explicily disposing of this instance? + protected virtual void Dispose(bool disposing) + { + if (disposing && !_disposed) + { + _codeDomProvider.Dispose(); + _disposed = true; + } + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/HasDynamicModelAttribute.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/HasDynamicModelAttribute.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,12 @@ +namespace RazorEngine.Compilation +{ + using System; + + /// + /// Defines an attribute that marks the presence of a dynamic model in a template. + /// + [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] + public sealed class HasDynamicModelAttribute : Attribute + { + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/ICompilerService.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/ICompilerService.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,48 @@ +namespace RazorEngine.Compilation +{ + using System; + using System.Collections.Generic; + using System.Reflection; + + using Inspectors; + + /// + /// Defines the required contract for implementing a compiler service. + /// + public interface ICompilerService + { + #region Properties + /// + /// Gets or sets the set of code inspectors. + /// + IEnumerable CodeInspectors { get; set; } + + /// + /// Gets or sets whether the compiler service is operating in debug mode. + /// + bool Debug { get; set; } + #endregion + + #region Methods + /// + /// Builds a type name for the specified template type. + /// + /// The template type. + /// The string type name (including namespace). + string BuildTypeName(Type templateType); + + /// + /// Compiles the type defined in the specified type context. + /// + /// The type context which defines the type to compile. + /// The compiled type. + Tuple CompileType(TypeContext context); + + /// + /// Returns a set of assemblies that must be referenced by the compiled template. + /// + /// The set of assemblies. + IEnumerable IncludeAssemblies(); + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/ICompilerServiceFactory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/ICompilerServiceFactory.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,17 @@ +namespace RazorEngine.Compilation +{ + /// + /// Defines the required contract for implementing a compiler service factory. + /// + public interface ICompilerServiceFactory + { + #region Methods + /// + /// Creates a that supports the specified language. + /// + /// The . + /// An instance of . + ICompilerService CreateCompilerService(Language language); + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/Inspectors/ICodeInspector.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/Inspectors/ICodeInspector.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,21 @@ +namespace RazorEngine.Compilation.Inspectors +{ + using System.CodeDom; + + /// + /// Defines the required contract for implementing a code inspector. + /// + public interface ICodeInspector + { + #region Methods + /// + /// Inspects the specified code unit. + /// + /// The code unit. + /// The code namespace declaration. + /// The code type declaration. + /// The code method declaration for the Execute method. + void Inspect(CodeCompileUnit unit, CodeNamespace ns, CodeTypeDeclaration type, CodeMemberMethod executeMethod); + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/RazorDynamicObject.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/RazorDynamicObject.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,80 @@ +namespace RazorEngine.Compilation +{ + using System; + using System.Diagnostics; + using System.Dynamic; + + /// + /// Defines a dynamic object. + /// + internal class RazorDynamicObject : DynamicObject + { + #region Properties + /// + /// Gets or sets the model. + /// + public object Model { get; set; } + + /// + /// Gets or sets whether to allow missing properties on dynamic members. + /// + public bool AllowMissingPropertiesOnDynamic { get; set; } + #endregion + + #region Methods + /// + /// Gets the value of the specified member. + /// + /// The current binder. + /// The member result. + /// True. + [DebuggerStepThrough] + public override bool TryGetMember(GetMemberBinder binder, out object result) + { + if (binder == null) + throw new ArgumentNullException("binder"); + + var dynamicObject = Model as RazorDynamicObject; + if (dynamicObject != null) + return dynamicObject.TryGetMember(binder, out result); + + Type modelType = Model.GetType(); + var prop = modelType.GetProperty(binder.Name); + if (prop == null) + { + if (!AllowMissingPropertiesOnDynamic) + { + result = null; + return false; + } + + result = new RazorDynamicObject() { AllowMissingPropertiesOnDynamic = AllowMissingPropertiesOnDynamic, Model = new object() }; + return true; + } + + object value = prop.GetValue(Model, null); + if (value == null) + { + result = value; + return true; + } + + Type valueType = value.GetType(); + + result = (CompilerServicesUtility.IsAnonymousType(valueType)) + ? new RazorDynamicObject { Model = value } + : value; + return true; + } + + /// + /// Returns the string representation of the current instance. + /// + /// The string representation of this instance. + public override string ToString() + { + return ""; + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/RazorEngineHost.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/RazorEngineHost.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,53 @@ +namespace RazorEngine.Compilation +{ + using System; + using System.Web.Razor; + using System.Web.Razor.Parser; + + /// + /// Defines the custom razor engine host. + /// + public class RazorEngineHost : System.Web.Razor.RazorEngineHost + { + #region Constructor + /// + /// Initialises a new instance of . + /// + /// The code language. + /// The markup parser factory delegate. + public RazorEngineHost(RazorCodeLanguage language, Func markupParserFactory) + : base(language, markupParserFactory) { } + #endregion + + #region Properties + /// + /// Gets or sets the default template type. + /// + public Type DefaultBaseTemplateType { get; set; } + + /// + /// Gets or sets the default model type. + /// + public Type DefaultModelType { get; set; } + + #endregion + + #region Methods + /// + /// Decorates the code parser. + /// + /// The code parser. + /// The decorated parser. + public override ParserBase DecorateCodeParser(ParserBase incomingCodeParser) + { + if (incomingCodeParser is CSharpCodeParser) + return new CSharp.CSharpCodeParser(); + + if (incomingCodeParser is VBCodeParser) + return new VisualBasic.VBCodeParser(); + + return base.DecorateCodeParser(incomingCodeParser); + } + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/TypeContext.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/TypeContext.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,49 @@ +namespace RazorEngine.Compilation +{ + using System; + using System.Collections.Generic; + + /// + /// Defines a type context that describes a template to compile. + /// + public class TypeContext : MarshalByRefObject + { + #region Constructor + /// + /// Initialises a new instance of . + /// + internal TypeContext() + { + ClassName = CompilerServicesUtility.GenerateClassName(); + Namespaces = new HashSet(); + } + #endregion + + #region Properties + /// + /// Gets the class name. + /// + public string ClassName { get; private set; } + + /// + /// Gets or sets the model type. + /// + public Type ModelType { get; set; } + + /// + /// Gets the set of namespace imports. + /// + public ISet Namespaces { get; private set; } + + /// + /// Gets or sets the template content. + /// + public string TemplateContent { get; set; } + + /// + /// Gets or sets the base template type. + /// + public Type TemplateType { get; set; } + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/VisualBasic/VBCodeParser.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/VisualBasic/VBCodeParser.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,110 @@ + +namespace RazorEngine.Compilation.VisualBasic +{ + using System; + using System.Linq; + using System.Web.Razor.Generator; + using System.Web.Razor.Tokenizer.Symbols; + using System.Web.Razor.Parser.SyntaxTree; + using System.Web.Razor.Text; + using CodeGenerators; + + /// + /// Defines a code parser that supports the VB syntax. + /// + public class VBCodeParser : System.Web.Razor.Parser.VBCodeParser + { + #region Fields + private const string GenericTypeFormatString = "{0}(Of {1})"; + private SourceLocation? _endInheritsLocation; + private bool _modelStatementFound; + #endregion + + #region Constructor + /// + /// Initialises a new instance of + /// + public VBCodeParser() + { + MapDirective("ModelType", ModelTypeDirective); + } + #endregion + + #region Methods + /// + /// Parses the inherits statement. + /// + protected override bool InheritsStatement() + { + // Verify we're on the right keyword and accept + Assert(VBKeyword.Inherits); + VBSymbol inherits = CurrentSymbol; + NextToken(); + _endInheritsLocation = CurrentLocation; + PutCurrentBack(); + PutBack(inherits); + EnsureCurrent(); + + bool result = base.InheritsStatement(); + CheckForInheritsAndModelStatements(); + return result; + } + + private void CheckForInheritsAndModelStatements() + { + if (_modelStatementFound && _endInheritsLocation.HasValue) + { + Context.OnError(_endInheritsLocation.Value, "The 'inherits' keyword is not allowed when a 'ModelType' keyword is used."); + } + } + + /// + /// Parses the modeltype statement. + /// + protected virtual bool ModelTypeDirective() + { + AssertDirective("ModelType"); + + Span.CodeGenerator = SpanCodeGenerator.Null; + Context.CurrentBlock.Type = BlockType.Directive; + + AcceptAndMoveNext(); + SourceLocation endModelLocation = CurrentLocation; + + if (At(VBSymbolType.WhiteSpace)) + { + Span.EditHandler.AcceptedCharacters = AcceptedCharacters.None; + } + + AcceptWhile(VBSymbolType.WhiteSpace); + Output(SpanKind.MetaCode); + + if (_modelStatementFound) + { + Context.OnError(endModelLocation, "Only one 'ModelType' statement is allowed in a file."); + } + _modelStatementFound = true; + + if (EndOfFile || At(VBSymbolType.WhiteSpace) || At(VBSymbolType.NewLine)) + { + Context.OnError(endModelLocation, "The 'ModelType' keyword must be followed by a type name on the same line."); + } + + // Just accept to a newline + AcceptUntil(VBSymbolType.NewLine); + if (!Context.DesignTimeMode) + { + // We want the newline to be treated as code, but it causes issues at design-time. + Optional(VBSymbolType.NewLine); + } + + string baseType = String.Concat(Span.Symbols.Select(s => s.Content)).Trim(); + Span.CodeGenerator = new SetModelTypeCodeGenerator(baseType, GenericTypeFormatString); + + CheckForInheritsAndModelStatements(); + Output(SpanKind.Code); + return false; + } + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/VisualBasic/VBDirectCompilerService.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/VisualBasic/VBDirectCompilerService.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,28 @@ +namespace RazorEngine.Compilation.VisualBasic +{ + using System; + using System.Diagnostics.CodeAnalysis; + using System.Web.Razor.Parser; + + using Microsoft.VisualBasic; + + /// + /// Defines a direct compiler service for the VB syntax. + /// + public class VBDirectCompilerService : DirectCompilerServiceBase + { + #region Constructor + /// + /// Initialises a new instance of . + /// + /// Specifies whether the strict mode parsing is enabled. + /// The markup parser to use. + [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "Disposed in base class: DirectCompilerServiceBase")] + public VBDirectCompilerService(bool strictMode = true, Func markupParserFactory = null) + : base( + new VBRazorCodeLanguage(strictMode), + new VBCodeProvider(), + markupParserFactory) { } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/VisualBasic/VBRazorCodeGenerator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/VisualBasic/VBRazorCodeGenerator.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,47 @@ +namespace RazorEngine.Compilation.VisualBasic +{ + using System.Web.Razor; + using System.Web.Razor.Parser.SyntaxTree; + using Templating; + + /// + /// Defines a code generator that supports VB syntax. + /// + public class VBRazorCodeGenerator : System.Web.Razor.Generator.VBRazorCodeGenerator + { + #region Constructor + /// + /// Initializes a new instance of the class. + /// + /// Name of the class. + /// Name of the root namespace. + /// Name of the source file. + /// The host. + /// Flag to specify that this generator is running in struct mode. + public VBRazorCodeGenerator(string className, string rootNamespaceName, string sourceFileName, RazorEngineHost host, bool strictMode) + : base(className, rootNamespaceName, sourceFileName, host) + { + StrictMode = strictMode; + } + #endregion + + #region Properties + /// + /// Gets whether the code generator is running in strict mode. + /// + public bool StrictMode { get; private set; } + #endregion + + #region Methods + /// + /// Visits an error generated through parsing. + /// + /// The error that was generated. + public override void VisitError(RazorError err) + { + if (StrictMode) + throw new TemplateParsingException(err); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Compilation/VisualBasic/VBRazorCodeLanguage.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Compilation/VisualBasic/VBRazorCodeLanguage.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,44 @@ +namespace RazorEngine.Compilation.VisualBasic +{ + using System.Web.Razor; + using System.Web.Razor.Generator; + + /// + /// Provides a razor code language that supports the VB language. + /// + public class VBRazorCodeLanguage : System.Web.Razor.VBRazorCodeLanguage + { + #region Constructor + /// + /// Initialises a new instance + /// + /// Flag to determine whether strict mode is enabled. + public VBRazorCodeLanguage(bool strictMode) + { + StrictMode = strictMode; + } + #endregion + + #region Properties + /// + /// Gets whether strict mode is enabled. + /// + public bool StrictMode { get; private set; } + #endregion + + #region Methods + /// + /// Creates the code generator. + /// + /// Name of the class. + /// Name of the root namespace. + /// Name of the source file. + /// The host. + /// An instance of . + public override RazorCodeGenerator CreateCodeGenerator(string className, string rootNamespaceName, string sourceFileName, RazorEngineHost host) + { + return new VBRazorCodeGenerator(className, rootNamespaceName, sourceFileName, host, StrictMode); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Configuration/Fluent/FluentConfigurationBuilder.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Configuration/Fluent/FluentConfigurationBuilder.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,285 @@ +namespace RazorEngine.Configuration +{ + using System; + using System.Diagnostics.Contracts; + + using Compilation; + using Compilation.Inspectors; + using Templating; + using Text; + + /// + /// Provides a default implementation of a . + /// + internal class FluentConfigurationBuilder : IConfigurationBuilder + { + #region Fields + private readonly TemplateServiceConfiguration _config; + #endregion + + #region Constructor + /// + /// Initialises a new instance of . + /// + /// The default configuration that we build a new configuration from. + public FluentConfigurationBuilder(TemplateServiceConfiguration config) + { + Contract.Requires(config != null); + + _config = config; + } + #endregion + + #region Methods + /// + /// Sets the activator. + /// + /// The activator instance. + /// The current configuration builder. + public IConfigurationBuilder ActivateUsing(IActivator activator) + { + if (activator == null) + throw new ArgumentNullException("activator"); + + _config.Activator = activator; + return this; + } + + /// + /// Sets the activator. + /// + /// The activator type. + /// The current configuration builder. + public IConfigurationBuilder ActivateUsing() where TActivator : IActivator, new() + { + return ActivateUsing(new TActivator()); + } + + /// + /// Sets the activator. + /// + /// The activator delegate. + /// The current configuration builder. + public IConfigurationBuilder ActivateUsing(Func activator) + { + if (activator == null) + throw new ArgumentNullException("activator"); + + _config.Activator = new DelegateActivator(activator); + return this; + } + + /// + /// Adds the specified code inspector. + /// + /// The code inspector type. + /// The current configuration builder. + public IConfigurationBuilder AddInspector() where TInspector : ICodeInspector, new() + { + return AddInspector(new TInspector()); + } + + /// + /// Adds the specified code inspector. + /// + /// The code inspector. + /// The current configuration builder. + public IConfigurationBuilder AddInspector(ICodeInspector inspector) + { + if (inspector == null) + throw new ArgumentNullException("inspector"); + + _config.CodeInspectors.Add(inspector); + return this; + } + + /// + /// Sets that dynamic models should be fault tollerant in accepting missing properties. + /// + /// The current configuration builder. + public IConfigurationBuilder AllowMissingPropertiesOnDynamic() + { + _config.AllowMissingPropertiesOnDynamic = true; + + return this; + } + + /// + /// Sets the compiler service factory. + /// + /// The compiler service factory. + /// The current configuration builder. + public IConfigurationBuilder CompileUsing(ICompilerServiceFactory factory) + { + if (factory == null) + throw new ArgumentNullException("factory"); + + _config.CompilerServiceFactory = factory; + return this; + } + + /// + /// Sets the compiler service factory. + /// + /// The compiler service factory type. + /// The current configuration builder. + public IConfigurationBuilder CompileUsing() + where TCompilerServiceFactory : ICompilerServiceFactory, new() + { + return CompileUsing(new TCompilerServiceFactory()); + } + + /// + /// Sets the encoded string factory. + /// + /// The encoded string factory. + /// The current configuration builder. + public IConfigurationBuilder EncodeUsing(IEncodedStringFactory factory) + { + if (factory == null) + throw new ArgumentNullException("factory"); + + _config.EncodedStringFactory = factory; + return this; + } + + /// + /// Sets the encoded string factory. + /// + /// The encoded string factory type. + /// The current configuration builder. + public IConfigurationBuilder EncodeUsing() + where TEncodedStringFactory : IEncodedStringFactory, new() + { + return EncodeUsing(new TEncodedStringFactory()); + } + + /// + /// Includes the specified namespaces + /// + /// The set of namespaces to include. + /// The current configuration builder. + public IConfigurationBuilder IncludeNamespaces(params string[] namespaces) + { + if (namespaces == null) + throw new ArgumentNullException("namespaces"); + + foreach (string ns in namespaces) + _config.Namespaces.Add(ns); + + return this; + } + + /// + /// Sets the resolve used to locate unknown templates. + /// + /// The resolve type. + /// The current configuration builder. + public IConfigurationBuilder ResolveUsing() where TResolver : ITemplateResolver, new() + { + _config.Resolver = new TResolver(); + return this; + } + + /// + /// Sets the resolver used to locate unknown templates. + /// + /// The resolver instance to use. + /// The current configuration builder. + public IConfigurationBuilder ResolveUsing(ITemplateResolver resolver) + { + Contract.Requires(resolver != null); + + _config.Resolver = resolver; + return this; + } + + /// + /// Sets the resolver delegate used to locate unknown templates. + /// + /// The resolver delegate to use. + /// The current configuration builder. + public IConfigurationBuilder ResolveUsing(Func resolver) + { + Contract.Requires(resolver != null); + + _config.Resolver = new DelegateTemplateResolver(resolver); + return this; + } + + /// + /// Sets the default activator. + /// + /// The current configuration builder. + public IConfigurationBuilder UseDefaultActivator() + { + _config.Activator = new DefaultActivator(); + return this; + } + + /// + /// Sets the default compiler service factory. + /// + /// The current configuration builder. + public IConfigurationBuilder UseDefaultCompilerServiceFactory() + { + _config.CompilerServiceFactory = new DefaultCompilerServiceFactory(); + return this; + } + + /// + /// Sets the default encoded string factory. + /// + /// The current configuration builder. + public IConfigurationBuilder UseDefaultEncodedStringFactory() + { + _config.EncodedStringFactory = new HtmlEncodedStringFactory(); + return this; + } + + /// + /// Sets the base template type. + /// + /// The base template type. + /// The current configuration builder/. + public IConfigurationBuilder WithBaseTemplateType(Type baseTemplateType) + { + _config.BaseTemplateType = baseTemplateType; + return this; + } + + /// + /// Sets the code language. + /// + /// The code language. + /// The current configuration builder. + public IConfigurationBuilder WithCodeLanguage(Language language) + { + _config.Language = language; + return this; + } + + /// + /// Sets the encoding. + /// + /// The encoding. + /// The current configuration builder. + public IConfigurationBuilder WithEncoding(Encoding encoding) + { + switch (encoding) + { + case Encoding.Html: + _config.EncodedStringFactory = new HtmlEncodedStringFactory(); + break; + case Encoding.Raw: + _config.EncodedStringFactory = new RawStringFactory(); + break; + default: + throw new ArgumentException("Unsupported encoding: " + encoding); + } + + return this; + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Configuration/Fluent/FluentTemplateServiceConfiguration.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Configuration/Fluent/FluentTemplateServiceConfiguration.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,116 @@ +namespace RazorEngine.Configuration +{ + using System; + using System.Collections.Generic; + using System.Diagnostics.Contracts; + + using Compilation; + using Compilation.Inspectors; + using Templating; + using Text; + + /// + /// Defines a fluent template service configuration + /// + public class FluentTemplateServiceConfiguration : ITemplateServiceConfiguration + { + #region Fields + private readonly TemplateServiceConfiguration _innerConfig = new TemplateServiceConfiguration(); + #endregion + + #region Constructor + /// + /// Initialises a new instance of . + /// + /// The delegate used to create the configuration. + public FluentTemplateServiceConfiguration(Action config) + { + Contract.Requires(config != null); + + config(new FluentConfigurationBuilder(_innerConfig)); + } + #endregion + + #region Properties + /// + /// Gets or sets the activator. + /// + public IActivator Activator + { + get { return _innerConfig.Activator; } + } + + /// + /// Gets or sets whether to allow missing properties on dynamic models. + /// + public bool AllowMissingPropertiesOnDynamic + { + get { return _innerConfig.AllowMissingPropertiesOnDynamic; } + } + + /// + /// Gets the base template type. + /// + public Type BaseTemplateType + { + get { return _innerConfig.BaseTemplateType; } + } + + /// + /// Gets the set of code inspectors. + /// + public IEnumerable CodeInspectors + { + get { return _innerConfig.CodeInspectors; } + } + + /// + /// Gets or sets the compiler service factory. + /// + public ICompilerServiceFactory CompilerServiceFactory + { + get { return _innerConfig.CompilerServiceFactory; } + } + + /// + /// Gets whether the template service is operating in debug mode. + /// + public bool Debug + { + get { return _innerConfig.Debug; } + } + + /// + /// Gets or sets the encoded string factory. + /// + public IEncodedStringFactory EncodedStringFactory + { + get { return _innerConfig.EncodedStringFactory; } + } + + /// + /// Gets or sets the language. + /// + public Language Language + { + get { return _innerConfig.Language; } + } + + /// + /// Gets or sets the collection of namespaces. + /// + public ISet Namespaces + { + get { return _innerConfig.Namespaces; } + } + + /// + /// Gets the resolver. + /// + public ITemplateResolver Resolver + { + get { return _innerConfig.Resolver; } + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Configuration/Fluent/IConfigurationBuilder.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Configuration/Fluent/IConfigurationBuilder.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,148 @@ +namespace RazorEngine.Configuration +{ + using System; + + using Compilation; + using Compilation.Inspectors; + using Templating; + using Text; + + /// + /// Defines the required contract for implementing a configuration builder. + /// + public interface IConfigurationBuilder + { + #region Methods + /// + /// Sets the activator. + /// + /// The activator instance. + /// The current configuration builder. + IConfigurationBuilder ActivateUsing(IActivator activator); + + /// + /// Sets the activator. + /// + /// The activator type. + /// The current configuration builder. + IConfigurationBuilder ActivateUsing() where TActivator : IActivator, new(); + + /// + /// Sets the activator. + /// + /// The activator delegate. + /// The current configuration builder. + IConfigurationBuilder ActivateUsing(Func activator); + + /// + /// Adds the specified code inspector. + /// + /// The code inspector type. + /// The current configuration builder. + IConfigurationBuilder AddInspector() where TInspector : ICodeInspector, new(); + + /// + /// Adds the specified code inspector. + /// + /// The code inspector. + /// The current configuration builder. + IConfigurationBuilder AddInspector(ICodeInspector inspector); + + /// + /// Sets the compiler service factory. + /// + /// The compiler service factory. + /// The current configuration builder. + IConfigurationBuilder CompileUsing(ICompilerServiceFactory factory); + + /// + /// Sets the compiler service factory. + /// + /// The compiler service factory type. + /// The current configuration builder. + IConfigurationBuilder CompileUsing() + where TCompilerServiceFactory : ICompilerServiceFactory, new(); + + /// + /// Sets the encoded string factory. + /// + /// The encoded string factory. + /// The current configuration builder. + IConfigurationBuilder EncodeUsing(IEncodedStringFactory factory); + + /// + /// Sets the encoded string factory. + /// + /// The encoded string factory type. + /// The current configuration builder. + IConfigurationBuilder EncodeUsing() where TEncodedStringFactory : IEncodedStringFactory, new(); + + /// + /// Sets the resolve used to locate unknown templates. + /// + /// The resolve type. + /// The current configuration builder. + IConfigurationBuilder ResolveUsing() where TResolver : ITemplateResolver, new(); + + /// + /// Sets the resolver used to locate unknown templates. + /// + /// The resolver instance to use. + /// The current configuration builder. + IConfigurationBuilder ResolveUsing(ITemplateResolver resolver); + + /// + /// Sets the resolver delegate used to locate unknown templates. + /// + /// The resolver delegate to use. + /// The current configuration builder. + IConfigurationBuilder ResolveUsing(Func resolver); + + /// + /// Includes the specified namespaces + /// + /// The set of namespaces to include. + /// The current configuration builder. + IConfigurationBuilder IncludeNamespaces(params string[] namespaces); + + /// + /// Sets the default activator. + /// + /// The current configuration builder. + IConfigurationBuilder UseDefaultActivator(); + + /// + /// Sets the default compiler service factory. + /// + /// The current configuration builder. + IConfigurationBuilder UseDefaultCompilerServiceFactory(); + + /// + /// Sets the default encoded string factory. + /// + /// The current configuration builder. + IConfigurationBuilder UseDefaultEncodedStringFactory(); + + /// + /// Sets the base template type. + /// + /// The base template type. + /// The current configuration builder/. + IConfigurationBuilder WithBaseTemplateType(Type baseTemplateType); + + /// + /// Sets the code language. + /// + /// The code language. + /// The current configuration builder. + IConfigurationBuilder WithCodeLanguage(Language language); + + /// + /// Sets the encoding. + /// + /// The encoding. + /// The current configuration builder. + IConfigurationBuilder WithEncoding(Encoding encoding); + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Configuration/ITemplateServiceConfiguration.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Configuration/ITemplateServiceConfiguration.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,68 @@ +namespace RazorEngine.Configuration +{ + using System; + using System.Collections.Generic; + + using Compilation; + using Compilation.Inspectors; + using Templating; + using Text; + + /// + /// Defines the required contract for implementing template service configuration. + /// + public interface ITemplateServiceConfiguration + { + #region Properties + /// + /// Gets the activator. + /// + IActivator Activator { get; } + + /// + /// Gets or sets whether to allow missing properties on dynamic models. + /// + bool AllowMissingPropertiesOnDynamic { get; } + + /// + /// Gets the base template type. + /// + Type BaseTemplateType { get; } + + /// + /// Gets the code inspectors. + /// + IEnumerable CodeInspectors { get; } + + /// + /// Gets the compiler service factory. + /// + ICompilerServiceFactory CompilerServiceFactory { get; } + + /// + /// Gets whether the template service is operating in debug mode. + /// + bool Debug { get; } + + /// + /// Gets the encoded string factory. + /// + IEncodedStringFactory EncodedStringFactory { get; } + + /// + /// Gets the language. + /// + Language Language { get; } + + /// + /// Gets the namespaces. + /// + ISet Namespaces { get; } + + /// + /// Gets the template resolver. + /// + ITemplateResolver Resolver { get; } + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Configuration/RazorEngineConfigurationSection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Configuration/RazorEngineConfigurationSection.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,100 @@ +namespace RazorEngine.Configuration +{ + using System.Configuration; + + using Xml; + + /// + /// Defines the main configuration section for the RazorEngine. + /// + public class RazorEngineConfigurationSection : ConfigurationSection + { + #region Fields + private const string ActivatorAttribute = "activatorType"; + private const string AllowMissingPropertiesOnDynamicAttribute = "allowMissingPropertiesOnDynamic"; + private const string CompilerServiceFactoryAttribute = "compilerServiceFactoryType"; + private const string DefaultLanguageAttribute = "defaultLanguage"; + private const string NamespacesElement = "namespaces"; + private const string SectionPath = "razorEngine"; + private const string TemplateResolverAttribute = "templateResolverType"; + private const string TemplateServicesElement = "templateServices"; + #endregion + + #region Properties + /// + /// Gets the activator type. + /// + [ConfigurationProperty(ActivatorAttribute, IsRequired = false)] + public string ActivatorType + { + get { return (string)this[ActivatorAttribute]; } + } + + /// + /// Gets or sets whether to allow missing properties on dynamic models. + /// + [ConfigurationProperty(AllowMissingPropertiesOnDynamicAttribute, IsRequired = false, DefaultValue = false)] + public bool AllowMissingPropertiesOnDynamic + { + get { return (bool)this[AllowMissingPropertiesOnDynamicAttribute]; } + } + + /// + /// Gets the compiler service factory type. + /// + [ConfigurationProperty(CompilerServiceFactoryAttribute, IsRequired = false)] + public string CompilerServiceFactoryType + { + get { return (string)this[CompilerServiceFactoryAttribute]; } + } + + /// + /// Gets or sets the default language. + /// + [ConfigurationProperty(DefaultLanguageAttribute, DefaultValue = Language.CSharp, IsRequired = false)] + public Language DefaultLanguage + { + get { return (Language)this[DefaultLanguageAttribute]; } + set { this[DefaultLanguageAttribute] = value; } + } + + /// + /// Gets the collection of namespaces. + /// + [ConfigurationProperty(NamespacesElement, IsRequired = false)] + public NamespaceConfigurationElementCollection Namespaces + { + get { return (NamespaceConfigurationElementCollection)this[NamespacesElement]; } + } + + /// + /// Gets the template resolver type. + /// + [ConfigurationProperty(TemplateResolverAttribute, IsRequired = false)] + public string TemplateResolverType + { + get { return (string)this[TemplateResolverAttribute]; } + } + + /// + /// Gets the collection of template service configurations. + /// + [ConfigurationProperty(TemplateServicesElement, IsRequired = false)] + public TemplateServiceConfigurationElementCollection TemplateServices + { + get { return (TemplateServiceConfigurationElementCollection)this[TemplateServicesElement]; } + } + #endregion + + #region Methods + /// + /// Gets an instance of that represents the current configuration. + /// + /// An instance of , or null if no configuration is specified. + public static RazorEngineConfigurationSection GetConfiguration() + { + return ConfigurationManager.GetSection(SectionPath) as RazorEngineConfigurationSection; + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Configuration/TemplateServiceConfiguration.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Configuration/TemplateServiceConfiguration.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,98 @@ +namespace RazorEngine.Configuration +{ + using System; + using System.Collections.Generic; + + using Compilation; + using Compilation.Inspectors; + using Templating; + using Text; + + /// + /// Provides a default implementation of a template service configuration. + /// + public class TemplateServiceConfiguration : ITemplateServiceConfiguration + { + #region Constructor + /// + /// Initialises a new instance of . + /// + public TemplateServiceConfiguration() + { + Activator = new DefaultActivator(); + CompilerServiceFactory = new DefaultCompilerServiceFactory(); + EncodedStringFactory = new HtmlEncodedStringFactory(); + CodeInspectors = new List(); + + Namespaces = new HashSet + { + "System", + "System.Collections.Generic", + "System.Linq" + }; + + var config = RazorEngineConfigurationSection.GetConfiguration(); + Language = (config == null) + ? Language.CSharp + : config.DefaultLanguage; + } + #endregion + + #region Properties + /// + /// Gets or sets the activator. + /// + public IActivator Activator { get; set; } + + /// + /// Gets or sets whether to allow missing properties on dynamic models. + /// + public bool AllowMissingPropertiesOnDynamic { get; set; } + + /// + /// Gets or sets the base template type. + /// + public Type BaseTemplateType { get; set; } + + /// + /// Gets the set of code inspectors. + /// + IEnumerable ITemplateServiceConfiguration.CodeInspectors { get { return CodeInspectors; } } + + /// + /// Gets the set of code inspectors. + /// + public IList CodeInspectors { get; private set; } + + /// + /// Gets or sets the compiler service factory. + /// + public ICompilerServiceFactory CompilerServiceFactory { get; set; } + + /// + /// Gets whether the template service is operating in debug mode. + /// + public bool Debug { get; set; } + + /// + /// Gets or sets the encoded string factory. + /// + public IEncodedStringFactory EncodedStringFactory { get; set; } + + /// + /// Gets or sets the language. + /// + public Language Language { get; set; } + + /// + /// Gets or sets the collection of namespaces. + /// + public ISet Namespaces { get; set; } + + /// + /// Gets or sets the template resolver. + /// + public ITemplateResolver Resolver { get; set; } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Configuration/Xml/NamespaceConfigurationElement.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Configuration/Xml/NamespaceConfigurationElement.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,25 @@ +namespace RazorEngine.Configuration.Xml +{ + using System.Configuration; + + /// + /// Defines a configuration of a namespace. + /// + public class NamespaceConfigurationElement : ConfigurationElement + { + #region Fields + private const string NamespaceAttribute = "namespace"; + #endregion + + #region Properties + /// + /// Gets the namespace. + /// + [ConfigurationProperty(NamespaceAttribute, IsRequired = true)] + public string Namespace + { + get { return (string)this[NamespaceAttribute]; } + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Configuration/Xml/NamespaceConfigurationElementCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Configuration/Xml/NamespaceConfigurationElementCollection.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,32 @@ +namespace RazorEngine.Configuration.Xml +{ + using System.Configuration; + + /// + /// Defines a collection of instances. + /// + [ConfigurationCollection(typeof(TemplateServiceConfigurationElement))] + public class NamespaceConfigurationElementCollection : ConfigurationElementCollection + { + #region Methods + /// + /// Creates a new for use with the collection. + /// + /// The instance. + protected override ConfigurationElement CreateNewElement() + { + return new NamespaceConfigurationElement(); + } + + /// + /// Gets a unique key for the specified element. + /// + /// The configuration element. + /// The key for the element. + protected override object GetElementKey(ConfigurationElement element) + { + return ((NamespaceConfigurationElement)element).Namespace; + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Configuration/Xml/TemplateServiceConfigurationElement.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Configuration/Xml/TemplateServiceConfigurationElement.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,76 @@ +namespace RazorEngine.Configuration.Xml +{ + using System.Configuration; + + /// + /// Defines a configuration of a template service. + /// + public class TemplateServiceConfigurationElement : ConfigurationElement + { + #region Fields + private const string BaseTemplateTypeAttribute = "baseTemplateType"; + private const string CodeInspectorsElement = "codeInspectors"; + private const string DebugAttribute = "debug"; + private const string EncodedStringFactoryAttribute = "encodedStringFactoryType"; + private const string LanguageAttribute = "language"; + private const string NameAttribute = "name"; + private const string NamespacesElement = "namespaces"; + #endregion + + #region Properties + /// + /// Gets the base template type. + /// + [ConfigurationProperty(BaseTemplateTypeAttribute, IsRequired = false)] + public string BaseTemplateType + { + get { return (string)this[BaseTemplateTypeAttribute]; } + } + + /// + /// Gets whether the template service is in debug mode. + /// + [ConfigurationProperty(DebugAttribute, IsRequired = false, DefaultValue = false)] + public bool Debug + { + get { return (bool)this[DebugAttribute]; } + } + + /// + /// Gets the encoded string factory type. + /// + [ConfigurationProperty(EncodedStringFactoryAttribute, IsRequired = false)] + public string EncodedStringFactoryType + { + get { return (string)this[EncodedStringFactoryAttribute]; } + } + + /// + /// Gets the language. + /// + [ConfigurationProperty(LanguageAttribute, IsRequired = false, DefaultValue = Language.CSharp)] + public Language Language + { + get { return (Language)this[LanguageAttribute]; } + } + + /// + /// Gets the name of the template service. + /// + [ConfigurationProperty(NameAttribute, IsRequired = true, IsKey = true)] + public string Name + { + get { return (string)this[NameAttribute]; } + } + + /// + /// Gets the collection of namespaces. + /// + [ConfigurationProperty(NamespacesElement, IsRequired = false)] + public NamespaceConfigurationElementCollection Namespaces + { + get { return (NamespaceConfigurationElementCollection)this[NamespacesElement]; } + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Configuration/Xml/TemplateServiceConfigurationElementCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Configuration/Xml/TemplateServiceConfigurationElementCollection.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,32 @@ +namespace RazorEngine.Configuration.Xml +{ + using System.Configuration; + + /// + /// Defines a collection of instances. + /// + [ConfigurationCollection(typeof(TemplateServiceConfigurationElement), AddItemName = "service")] + public class TemplateServiceConfigurationElementCollection : ConfigurationElementCollection + { + #region Methods + /// + /// Creates a new for use with the collection. + /// + /// The instance. + protected override ConfigurationElement CreateNewElement() + { + return new TemplateServiceConfigurationElement(); + } + + /// + /// Gets a unique key for the specified element. + /// + /// The configuration element. + /// The key for the element. + protected override object GetElementKey(ConfigurationElement element) + { + return ((TemplateServiceConfigurationElement)element).Name; + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Configuration/Xml/XmlTemplateServiceConfiguration.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Configuration/Xml/XmlTemplateServiceConfiguration.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,247 @@ +namespace RazorEngine.Configuration.Xml +{ + using System; + using System.Collections.Generic; + using System.Configuration; + using System.Linq; + + using Compilation; + using Compilation.Inspectors; + using Templating; + using Text; + + /// + /// Represents a template service configuration that supports the xml configuration mechanism. + /// + public class XmlTemplateServiceConfiguration : ITemplateServiceConfiguration + { + #region Constructor + /// + /// Initialises a new instance of . + /// + /// The name of the template service configuration. + public XmlTemplateServiceConfiguration(string name) + { + if (string.IsNullOrWhiteSpace(name)) + throw new ArgumentException("'name' is a required parameter.", "name"); + + Namespaces = new HashSet(); + + InitialiseConfiguration(name); + } + #endregion + + #region Properties + /// + /// Gets the activator. + /// + public IActivator Activator { get; private set; } + + /// + /// Gets or sets whether to allow missing properties on dynamic models. + /// + public bool AllowMissingPropertiesOnDynamic { get; private set; } + + /// + /// Gets the base template type. + /// + public Type BaseTemplateType { get; private set; } + + /// + /// Gets the code inspectors. + /// + public IEnumerable CodeInspectors { get; private set; } + + /// + /// Gets the compiler service factory. + /// + public ICompilerServiceFactory CompilerServiceFactory { get; private set; } + + /// + /// Gets whether the template service is operating in debug mode. + /// + public bool Debug { get; private set; } + + /// + /// Gets the encoded string factory. + /// + public IEncodedStringFactory EncodedStringFactory { get; private set; } + + /// + /// Gets the language. + /// + public Language Language { get; private set; } + + /// + /// Gets the namespaces. + /// + public ISet Namespaces { get; private set; } + + /// + /// Gets the template resolver. + /// + public ITemplateResolver Resolver { get; private set; } + #endregion + + #region Methods + /// + /// Adds the namespaces from the specified collection. + /// + /// The set of namespace configurations. + private void AddNamespaces(NamespaceConfigurationElementCollection namespaces) + { + if (namespaces == null || namespaces.Count == 0) + return; + + foreach (NamespaceConfigurationElement config in namespaces) + Namespaces.Add(config.Namespace); + } + + /// + /// Gets an instance of the specified type. + /// + /// The expected instance type. + /// The type. + /// The instance. + private T GetInstance(Type type) + { + Type instanceType = typeof(T); + + if (!instanceType.IsAssignableFrom(type)) + throw new ConfigurationErrorsException("The type '" + type.FullName + "' is not assignable to type '" + instanceType.FullName + "'"); + + return (T)System.Activator.CreateInstance(type); + } + + /// + /// Gets the type with the specified name. + /// + /// The type name. + /// + private Type GetType(string typeName) + { + if (string.IsNullOrWhiteSpace(typeName)) + return null; + + var type = Type.GetType(typeName); + if (type == null) + throw new ConfigurationErrorsException("The type '" + typeName + "' could not be loaded."); + + return type; + } + + /// + /// Initialises the configuration. + /// + /// The name of the template service configuration. + private void InitialiseConfiguration(string name) + { + var config = RazorEngineConfigurationSection.GetConfiguration(); + if (config == null) + throw new ConfigurationErrorsException("No configuration section has been defined."); + + var serviceConfig = config.TemplateServices + .OfType() + .Where(t => t.Name.Equals(name, StringComparison.OrdinalIgnoreCase)) + .SingleOrDefault(); + + if (serviceConfig == null) + throw new ConfigurationErrorsException("No configuration element defined with name = '" + name + "'"); + + InitialiseConfiguration(config, serviceConfig); + } + + /// + /// Initialises the configuration. + /// + /// The core configuration. + /// The service configuration. + private void InitialiseConfiguration(RazorEngineConfigurationSection config, TemplateServiceConfigurationElement serviceConfig) + { + // Set whether we are allowing missing properties on dynamic. + AllowMissingPropertiesOnDynamic = config.AllowMissingPropertiesOnDynamic; + + // Add the global namespaces. + AddNamespaces(config.Namespaces); + + // Add the specific namespaces. + AddNamespaces(serviceConfig.Namespaces); + + // Sets the activator. + SetActivator(config.ActivatorType); + + // Sets the base template type. + SetBaseTemplateType(serviceConfig.BaseTemplateType); + + // Sets the compiler service factory. + SetCompilerServiceFactory(config.CompilerServiceFactoryType); + + Debug = serviceConfig.Debug; + + // Sets the encoded string factory. + SetEncodedStringFactory(serviceConfig.EncodedStringFactoryType); + + // Set the language. + Language = serviceConfig.Language; + + // Sets the tempalte resolver. + SetTemplateResolver(config.TemplateResolverType); + } + + /// + /// Sets the activator. + /// + /// The activator type. + private void SetActivator(string activatorType) + { + var type = GetType(activatorType); + if (type != null) + Activator = GetInstance(type); + } + + /// + /// Sets the base template type. + /// + /// The base template type. + private void SetBaseTemplateType(string baseTemplateType) + { + var type = GetType(baseTemplateType); + if (type != null) + BaseTemplateType = type; + } + + /// + /// Sets the compiler service factory. + /// + /// The compiler service factory type. + private void SetCompilerServiceFactory(string compilerServiceFactoryType) + { + var type = GetType(compilerServiceFactoryType); + if (type != null) + CompilerServiceFactory = GetInstance(type); + } + + /// + /// Sets the encoded string factory. + /// + /// + private void SetEncodedStringFactory(string encodedStringFactoryType) + { + var type = GetType(encodedStringFactoryType); + if (type != null) + EncodedStringFactory = GetInstance(type); + } + + /// + /// Sets the template resolver. + /// + /// The template resolver type. + private void SetTemplateResolver(string templateResolverType) + { + var type = GetType(templateResolverType); + if (type != null) + Resolver = GetInstance(type); + } + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Encoding.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Encoding.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,18 @@ +namespace RazorEngine +{ + /// + /// Defines the possible values for encoding. + /// + public enum Encoding + { + /// + /// Use html encoding. + /// + Html, + + /// + /// Use raw text (no encoding) + /// + Raw + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Language.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Language.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,18 @@ +namespace RazorEngine +{ + /// + /// Defines the possible supported code languages. + /// + public enum Language + { + /// + /// C# Language + /// + CSharp, + + /// + /// Visual Basic Language + /// + VisualBasic + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/PositionTagged.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/PositionTagged.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,67 @@ +using RazorEngine.Common; + +namespace RazorEngine +{ + using System; + using System.Diagnostics; + + [DebuggerDisplay("({Position})\"{Value}\"")] + public class PositionTagged + { + private PositionTagged() + { + Position = 0; + Value = default(T); + } + + public PositionTagged(T value, int offset) + { + Position = offset; + Value = value; + } + + public int Position { get; private set; } + public T Value { get; private set; } + + public override bool Equals(object obj) + { + PositionTagged other = obj as PositionTagged; + return other != null && + other.Position == Position && + Equals(other.Value, Value); + } + + public override int GetHashCode() + { + return HashCodeCombiner.Start() + .Add(Position) + .Add(Value) + .CombinedHash; + } + + public override string ToString() + { + return Value.ToString(); + } + + public static implicit operator T(PositionTagged value) + { + return value.Value; + } + + public static implicit operator PositionTagged(Tuple value) + { + return new PositionTagged(value.Item1, value.Item2); + } + + public static bool operator ==(PositionTagged left, PositionTagged right) + { + return Equals(left, right); + } + + public static bool operator !=(PositionTagged left, PositionTagged right) + { + return !Equals(left, right); + } + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Properties/AssemblyInfo.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,20 @@ +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("RazorEngine.Core")] +[assembly: AssemblyDescription("RazorEngine - Core Framework")] + +// 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("c11064c2-11b8-420b-81f0-4c6477cb5931")] + +// Allow the test assembly access to internals. +[assembly: InternalsVisibleTo("RazorEngine.Core.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100ad3b3604eb9ba317840ece0a65ec22fa67ee54cb4abb5148f184a90d9e9cdbc77c098fe3447ce9e13ef73d3e046016e7053f4c5c0ccd9f521514200dd09aa12cedc63bf39c30eb0516ac6b42bb645dfd41902290a87ceaf0309a9f08bfdd9cceb27b6186bfbe68ca91dca2508820c0723b0e4d94f3ef8049b8aa3f524d4715ca")] diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Razor.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Razor.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,622 @@ +namespace RazorEngine +{ + using System; + using System.Collections.Generic; + using System.Diagnostics.Contracts; + using System.Linq; + + using Templating; + + /// + /// Provides quick access to template functions. + /// + public static class Razor + { + #region Fields + private static ITemplateService _service = new TemplateService(); + private static readonly object _sync = new object(); + #endregion + + #region Properties + /// + /// Gets the template service. + /// + private static ITemplateService TemplateService + { + get + { + lock (_sync) + return _service; + } + } + #endregion + + #region Methods + /// + /// Compiles the specified template. + /// + /// The string template. + /// The name of the template type in cache. + public static void Compile(string razorTemplate, string cacheName) + { + TemplateService.Compile(razorTemplate, null, cacheName); + } + + /// + /// Compiles the specified template. + /// + /// The string template. + /// The model type. + /// The name of the template type in cache. + public static void Compile(string razorTemplate, Type modelType, string cacheName) + { + TemplateService.Compile(razorTemplate, modelType, cacheName); + } + + /// + /// Compiles the specified template. + /// + /// The model type. + /// The string template. + /// The name of the template type in cache. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "We already provide a non-generic alternative.")] + public static void Compile(string razorTemplate, string cacheName) + { + TemplateService.Compile(razorTemplate, typeof(T), cacheName); + } + + /// + /// Creates an instance of from the specified string template. + /// + /// The string template. + /// An instance of . + public static ITemplate CreateTemplate(string razorTemplate) + { + return TemplateService.CreateTemplate(razorTemplate, null, null); + } + + /// + /// Creates an instance of from the specified string template. + /// + /// The model type. + /// The string template. + /// The model instance. + /// An instance of . + public static ITemplate CreateTemplate(string razorTemplate, T model) + { + return TemplateService.CreateTemplate(razorTemplate, null, model); + } + + /// + /// Creates a set of templates from the specified string templates. + /// + /// The set of templates to create instances for. + /// Flag to determine whether to create templates in parallel. + /// The enumerable set of template instances. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] + public static IEnumerable CreateTemplates(IEnumerable razorTemplates, bool parallel = false) + { + return TemplateService.CreateTemplates(razorTemplates, null, null, parallel); + } + + /// + /// Creates a set of templates from the specified string templates and models. + /// + /// The model type. + /// The set of templates to create instances for. + /// The set of models used to assign to templates. + /// Flag to determine whether to create templates in parallel. + /// The enumerable set of template instances. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] + public static IEnumerable CreateTemplates(IEnumerable razorTemplates, IEnumerable models, bool parallel = false) + { + List modelList = (from m in models select (object)m).ToList(); + return TemplateService.CreateTemplates(razorTemplates, null, modelList, parallel); + } + + /// + /// Creates a that can be used to instantiate an instance of a template. + /// + /// The string template. + /// An instance of . + public static Type CreateTemplateType(string razorTemplate) + { + return TemplateService.CreateTemplateType(razorTemplate, null); + } + + /// + /// Creates a that can be used to instantiate an instance of a template. + /// + /// The string template. + /// The model type. + /// An instance of . + public static Type CreateTemplateType(string razorTemplate, Type modelType) + { + return TemplateService.CreateTemplateType(razorTemplate, modelType); + } + + /// + /// Crates a set of template types from the specfied string templates. + /// + /// The set of templates to create instances for. + /// Flag to determine whether to create template types in parallel. + /// The set of instances. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] + public static IEnumerable CreateTemplateTypes(IEnumerable razorTemplates, bool parallel = false) + { + return TemplateService.CreateTemplateTypes(razorTemplates, null, parallel); + } + + /// + /// Creates a set of template types from the specfied string templates. + /// + /// The set of templates to create instances for. + /// The model type. + /// Flag to determine whether to create template types in parallel. + /// The set of instances. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] + public static IEnumerable CreateTemplateTypes(IEnumerable razorTemplates, Type modelType, bool parallel = false) + { + IEnumerable modelTypes = Enumerable.Repeat(modelType, razorTemplates.Count()); + return TemplateService.CreateTemplateTypes(razorTemplates, modelTypes, parallel); + } + + /// + /// Gets an instance of the template using the cached compiled type, or compiles the template type + /// if it does not exist in the cache. + /// + /// The string template. + /// The name of the template type in the cache. + /// An instance of . + public static ITemplate GetTemplate(string razorTemplate, string cacheName) + { + return TemplateService.GetTemplate(razorTemplate, null, cacheName); + } + + /// + /// Gets an instance of the template using the cached compiled type, or compiles the template type + /// if it does not exist in the cache. + /// + /// The model type. + /// The string template. + /// The model instance. + /// The name of the template type in the cache. + /// An instance of . + public static ITemplate GetTemplate(string razorTemplate, T model, string cacheName) + { + return TemplateService.GetTemplate(razorTemplate, model, cacheName); + } + + /// + /// Gets the set of template instances for the specified string templates. Cached templates will be considered + /// and if they do not exist, new types will be created and instantiated. + /// + /// The set of templates to create. + /// The set of cache names. + /// Flag to determine whether to get the templates in parallel. + /// The set of instances. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] + public static IEnumerable GetTemplates(IEnumerable razorTemplates, IEnumerable cacheNames, bool parallel = false) + { + return TemplateService.GetTemplates(razorTemplates, null, cacheNames, parallel); + } + + /// + /// Gets the set of template instances for the specified string templates. Cached templates will be considered + /// and if they do not exist, new types will be created and instantiated. + /// + /// The model type. + /// The set of templates to create. + /// The set of models. + /// The set of cache names. + /// Flag to determine whether to get the templates in parallel. + /// The set of instances. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] + public static IEnumerable GetTemplates(IEnumerable razorTemplates, IEnumerable models, IEnumerable cacheNames, bool parallel = false) + { + List modelList = (from m in models select (object)m).ToList(); + return TemplateService.GetTemplates(razorTemplates, modelList, cacheNames, parallel); + } + + /// + /// Parses and returns the result of the specified string template. + /// + /// The string template. + /// The string result of the template. + public static string Parse(string razorTemplate) + { + return TemplateService.Parse(razorTemplate, null, null, null); + } + + /// + /// Parses and returns the result of the specified string template. + /// This method will provide a cache check to see if the compiled template type already exists and is valid. + /// + /// The string template. + /// The name of the template type in the cache or NULL if no caching is desired. + /// The string result of the template. + public static string Parse(string razorTemplate, string cacheName) + { + return TemplateService.Parse(razorTemplate, null, null, cacheName); + } + + /// + /// Parses and returns the result of the specified string template. + /// + /// The string template. + /// The model instance. + /// The string result of the template. + public static string Parse(string razorTemplate, object model) + { + return TemplateService.Parse(razorTemplate, model, null, null); + } + + /// + /// Parses and returns the result of the specified string template. + /// + /// The model type. + /// The string template. + /// The model instance. + /// The string result of the template. + public static string Parse(string razorTemplate, T model) + { + return TemplateService.Parse(razorTemplate, model, null, null); + } + + /// + /// Parses and returns the result of the specified string template. + /// + /// The model type. + /// The string template. + /// The model instance. + /// The name of the template type in the cache or NULL if no caching is desired. + /// The string result of the template. + public static string Parse(string razorTemplate, T model, string cacheName) + { + return TemplateService.Parse(razorTemplate, model, null, cacheName); + } + + /// + /// Parses and returns the result of the specified string template. + /// + /// The model type. + /// The string template. + /// The model instance. + /// The ViewBag contents or NULL for an initially empty ViewBag. + /// The name of the template type in the cache or NULL if no caching is desired. + /// The string result of the template. + public static string Parse(string razorTemplate, T model, DynamicViewBag viewBag, string cacheName) + { + return TemplateService.Parse(razorTemplate, model, viewBag, cacheName); + } + + /// + /// Parses and returns the result of the specified string template. + /// + /// The string template. + /// The model instance. + /// The name of the template type in the cache or NULL if no caching is desired. + /// The string result of the template. + public static string Parse(string razorTemplate, object model, string cacheName) + { + return TemplateService.Parse(razorTemplate, model, null, cacheName); + } + + /// + /// Parses and returns the result of the specified string template. + /// + /// The string template. + /// The model instance. + /// The ViewBag contents or NULL for an initially empty ViewBag. + /// The name of the template type in the cache or NULL if no caching is desired. + /// The string result of the template. + public static string Parse(string razorTemplate, object model, DynamicViewBag viewBag, string cacheName) + { + return TemplateService.Parse(razorTemplate, model, viewBag, cacheName); + } + + /// + /// Parses the template and merges with the many models provided. + /// + /// The razor template. + /// + /// The set of models (must contain at least one model). + /// + /// Flag to determine whether parsing in parallel. + /// The set of parsed template results. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] + public static IEnumerable ParseMany(string razorTemplate, IEnumerable models, bool parallel = false) + { + if (models == null) + throw new ArgumentException("Expected models list (this parameter may not be NULL)."); + + if (models.Count() == 0) + throw new ArgumentException("Expected at least one entry in models list."); + + List razorTemplateList = Enumerable.Repeat(razorTemplate, models.Count()).ToList(); + return TemplateService.ParseMany(razorTemplateList, models, null, null, parallel); + } + + /// + /// Parses the specified set of templates. + /// + /// The set of string templates to parse. + /// Flag to determine whether parsing in templates. + /// The set of parsed template results. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] + public static IEnumerable ParseMany(IEnumerable razorTemplates, bool parallel = false) + { + return TemplateService.ParseMany(razorTemplates, null, null, null, parallel); + } + + /// + /// Parses the specified set of templates. + /// + /// The set of string templates to parse. + /// + /// The set of models or NULL if no models exist for all templates. + /// Individual elements in this set may be NULL if no model exists for a specific template. + /// + /// Flag to determine whether parsing in templates. + /// The set of parsed template results. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] + public static IEnumerable ParseMany(IEnumerable razorTemplates, IEnumerable models, bool parallel = false) + { + return TemplateService.ParseMany(razorTemplates, models, null, null, parallel); + } + + /// + /// Parses the specified set of templates. + /// + /// The set of string templates to parse. + /// + /// The set of cache names or NULL if no caching is desired for templates. + /// Individual elements in this set may be NULL if caching is not desired for a specific template. + /// + /// Flag to determine whether parsing in templates. + /// The set of parsed template results. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] + public static IEnumerable ParseMany(IEnumerable razorTemplates, IEnumerable cacheNames, bool parallel = false) + { + return TemplateService.ParseMany(razorTemplates, null, null, cacheNames, parallel); + } + + /// + /// Parses the specified set of templates. + /// + /// The set of string templates to parse. + /// + /// The set of models or NULL if no models exist for all templates. + /// Individual elements in this set may be NULL if no model exists for a specific template. + /// + /// + /// The set of cache names or NULL if no caching is desired for templates. + /// Individual elements in this set may be NULL if caching is not desired for a specific template. + /// + /// Flag to determine whether parsing in templates. + /// The set of parsed template results. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] + public static IEnumerable ParseMany(IEnumerable razorTemplates, IEnumerable models, IEnumerable cacheNames, bool parallel = false) + { + return TemplateService.ParseMany(razorTemplates, models, null, cacheNames, parallel); + } + + /// + /// Parses the specified set of templates. + /// + /// The set of string templates to parse. + /// + /// The set of models or NULL if no models exist for all templates. + /// Individual elements in this set may be NULL if no model exists for a specific template. + /// + /// + /// The set of initial ViewBag contents or NULL for an initially empty ViewBag for all templates. + /// Individual elements in this set may be NULL if an initially empty ViewBag is desired for a specific template. + /// + /// + /// The set of cache names or NULL if no caching is desired for templates. + /// Individual elements in this set may be NULL if caching is not desired for a specific template. + /// + /// Flag to determine whether parsing in templates. + /// The set of parsed template results. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] + public static IEnumerable ParseMany(IEnumerable razorTemplates, IEnumerable models, IEnumerable viewBags, IEnumerable cacheNames, bool parallel = false) + { + return TemplateService.ParseMany(razorTemplates, models, viewBags, cacheNames, parallel); + } + + /// + /// Parses the template and merges with the many models provided. + /// + /// The model type. + /// The razor template. + /// + /// The set of models (must contain at least one model). + /// + /// Flag to determine whether parsing in parallel. + /// The set of parsed template results. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] + public static IEnumerable ParseMany(string razorTemplate, IEnumerable models, bool parallel = false) + { + if (models == null) + throw new ArgumentException("Expected models list (this parameter may not be NULL)."); + + if (models.Count() == 0) + throw new ArgumentException("Expected at least one entry in models list."); + + List razorTemplateList = Enumerable.Repeat(razorTemplate, models.Count()).ToList(); + List modelList = (from m in models select (object)m).ToList(); + return TemplateService.ParseMany(razorTemplateList, modelList, null, null, parallel); + } + + /// + /// Parses the specified set of templates. + /// + /// The model type. + /// The set of string templates to parse. + /// + /// The set of models or NULL if no models exist for all templates. + /// Individual elements in this set may be NULL if no model exists for a specific template. + /// + /// Flag to determine whether parsing in templates. + /// The set of parsed template results. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] + public static IEnumerable ParseMany(IEnumerable razorTemplates, IEnumerable models, bool parallel = false) + { + List modelList = (from m in models select (object)m).ToList(); + return TemplateService.ParseMany(razorTemplates, modelList, null, null, parallel); + } + + /// + /// Parses the specified set of templates. + /// + /// The model type. + /// The set of string templates to parse. + /// + /// The set of models or NULL if no models exist for all templates. + /// Individual elements in this set may be NULL if no model exists for a specific template. + /// + /// + /// The set of cache names or NULL if no caching is desired for templates. + /// Individual elements in this set may be NULL if caching is not desired for a specific template. + /// + /// Flag to determine whether parsing in templates. + /// The set of parsed template results. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] + public static IEnumerable ParseMany(IEnumerable razorTemplates, IEnumerable models, IEnumerable cacheNames, bool parallel = false) + { + List modelList = (from m in models select (object)m).ToList(); + return TemplateService.ParseMany(razorTemplates, modelList, null, cacheNames, parallel); + } + + /// + /// Parses the specified set of templates. + /// + /// The model type. + /// The set of string templates to parse. + /// + /// The set of models or NULL if no models exist for all templates. + /// Individual elements in this set may be NULL if no model exists for a specific template. + /// + /// + /// The set of initial ViewBag contents or NULL for an initially empty ViewBag for all templates. + /// Individual elements in this set may be NULL if an initially empty ViewBag is desired for a specific template. + /// + /// + /// The set of cache names or NULL if no caching is desired for templates. + /// Individual elements in this set may be NULL if caching is not desired for a specific template. + /// + /// Flag to determine whether parsing in templates. + /// The set of parsed template results. + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] + public static IEnumerable ParseMany(IEnumerable razorTemplates, IEnumerable models, IEnumerable viewBags, IEnumerable cacheNames, bool parallel = false) + { + List modelList = (from m in models select (object)m).ToList(); + return TemplateService.ParseMany(razorTemplates, modelList, viewBags, cacheNames, parallel); + } + + /// + /// Resolves the template with the specified name. + /// + /// The name of the template type in cache. + /// The resolved template. + public static ITemplate Resolve(string cacheName) + { + return TemplateService.Resolve(cacheName, null); + } + + /// + /// Resolves the template with the specified name. + /// + /// The name of the template type in cache. + /// The model for the template. + /// The resolved template. + public static ITemplate Resolve(string cacheName, object model) + { + return TemplateService.Resolve(cacheName, model); + } + + /// + /// Resolves the template with the specified name. + /// + /// + /// The name of the template type in cache. + /// The model for the template. + /// The resolved template. + public static ITemplate Resolve(string cacheName, T model) + { + return TemplateService.Resolve(cacheName, model); + } + + /// + /// Runs the template with the specified name. + /// + /// The name of the template type in cache. + /// The string result of the template. + public static string Run(string cacheName) + { + return TemplateService.Run(cacheName, null, null); + } + + /// + /// Runs the template with the specified name. + /// + /// The name of the template type in cache. + /// The model. + /// The string result of the template. + public static string Run(string cacheName, object model) + { + return TemplateService.Run(cacheName, model, null); + } + + /// + /// Runs the template with the specified name. + /// + /// The name of the template type in cache. + /// The model. + /// The ViewBag contents or NULL for an initially empty ViewBag. + /// The string result of the template. + public static string Run(string cacheName, object model, DynamicViewBag viewBag) + { + return TemplateService.Run(cacheName, model, viewBag); + } + + /// + /// Runs the template with the specified name. + /// + /// The model type. + /// The name of the template type in cache. + /// The model. + /// The string result of the template. + public static string Run(string cacheName, T model) + { + return TemplateService.Run(cacheName, model, null); + } + + /// + /// Runs the template with the specified name. + /// + /// The model type. + /// The name of the template type in cache. + /// The model. + /// The ViewBag contents or NULL for an initially empty ViewBag. + /// The string result of the template. + public static string Run(string cacheName, T model, DynamicViewBag viewBag) + { + return TemplateService.Run(cacheName, model, viewBag); + } + + /// + /// Sets the template service. + /// + /// The template service. + public static void SetTemplateService(ITemplateService service) + { + Contract.Requires(service != null); + + lock (_sync) + _service = service; + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/RazorEngine.Core.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/RazorEngine.Core.csproj Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,175 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {D268F86D-2DAB-4329-A75F-3BCF6D5BCDC4} + Library + Properties + RazorEngine + RazorEngine + v4.5 + 512 + 1 + + + + true + full + false + bin\Debug\ + TRACE;DEBUG + prompt + 4 + True + False + True + False + False + True + True + True + True + True + True + False + True + + + + + + ..\..\baseline.xml + True + Full + %28none%29 + bin\Debug\RazorEngine.XML + AllRules.ruleset + false + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + bin\Release\RazorEngine.XML + + + true + + + RazorEngine.snk + + + + + + + + False + ..\..\packages\Microsoft.AspNet.Razor.3.0.0\lib\net45\System.Web.Razor.dll + + + + + Properties\SharedAssemblyInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + xcopy "$(TargetDir)RazorEngine.*" "$(SolutionDir)..\nuget\lib\net45" /y + + + \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/RazorEngine.snk Binary file src/Core/RazorEngine.Core/RazorEngine.snk has changed diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/CachedTemplateItem.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/CachedTemplateItem.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,35 @@ +namespace RazorEngine.Templating +{ + using System; + + /// + /// Defines a cached template item. + /// + internal class CachedTemplateItem + { + #region Constructor + /// + /// Initialises a new instance of . + /// + /// The cached hash code. + /// The template type. + public CachedTemplateItem(int cachedHashCode, Type templateType) + { + CachedHashCode = cachedHashCode; + TemplateType = templateType; + } + #endregion + + #region Properties + /// + /// Gets the cached hash code of the template. + /// + public int CachedHashCode { get; private set; } + + /// + /// Gets the template type. + /// + public Type TemplateType { get; private set; } + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/DefaultActivator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/DefaultActivator.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,27 @@ +namespace RazorEngine.Templating +{ + using System; + using System.Diagnostics.Contracts; + + /// + /// Provides a default implementation of an . + /// + internal class DefaultActivator : IActivator + { + #region Methods + /// + /// Creates an instance of the specifed template. + /// + /// The instance context. + /// An instance of . + [Pure] + public ITemplate CreateInstance(InstanceContext context) + { + if (context == null) + throw new ArgumentNullException("context"); + + return context.Loader.CreateInstance(context.TemplateType); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/DefaultAppDomainFactory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/DefaultAppDomainFactory.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,24 @@ +namespace RazorEngine.Templating +{ + using System; + + /// + /// Provides a default implementation of an factory. + /// + public class DefaultAppDomainFactory : IAppDomainFactory + { + #region Methods + /// + /// Creates the . + /// + /// The instance. + public AppDomain CreateAppDomain() + { + var current = AppDomain.CurrentDomain; + var domain = AppDomain.CreateDomain("RazorHost", current.Evidence, current.SetupInformation); + + return domain; + } + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/DelegateActivator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/DelegateActivator.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,48 @@ +namespace RazorEngine.Templating +{ + using System; + using System.Diagnostics.Contracts; + + /// + /// Defines an activator that supports delegated activation. + /// + internal class DelegateActivator : IActivator + { + #region Fields + private readonly Func _activator; + #endregion + + #region Constructor + /// + /// Initialises a new instance of . + /// + /// The delegated used to create an instance of the template. + public DelegateActivator(Func activator) + { + Contract.Requires(activator != null); + + _activator = activator; + } + #endregion + + #region Properties + /// + /// Gets the activator. + /// + internal Func Activator { get { return _activator; } } + #endregion + + #region Methods + /// + /// Creates an instance of the specifed template. + /// + /// The instance context. + /// An instance of . + [Pure] + public ITemplate CreateInstance(InstanceContext context) + { + return _activator(context); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/DelegateAppDomainFactory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/DelegateAppDomainFactory.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,39 @@ +namespace RazorEngine.Templating +{ + using System; + using System.Diagnostics.Contracts; + + /// + /// Provides an factory that supports delegated creation. + /// + internal class DelegateAppDomainFactory : IAppDomainFactory + { + #region Fields + private readonly Func _factory; + #endregion + + #region Constructor + /// + /// Initialises a new instance of . + /// + /// The factory delegate. + public DelegateAppDomainFactory(Func factory) + { + Contract.Requires(factory != null); + + _factory = factory; + } + #endregion + + #region Methods + /// + /// Creates the . + /// + /// The instance. + public AppDomain CreateAppDomain() + { + return _factory(); + } + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/DelegateTemplateResolver.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/DelegateTemplateResolver.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,40 @@ +namespace RazorEngine.Templating +{ + using System; + using System.Diagnostics.Contracts; + + /// + /// Provides an that supports delegated template resolution. + /// + public class DelegateTemplateResolver : ITemplateResolver + { + #region Fields + private readonly Func _resolver; + #endregion + + #region Constructor + /// + /// Initialises a new instance of . + /// + /// The resolver delegate. + public DelegateTemplateResolver(Func resolver) + { + Contract.Requires(resolver != null); + + _resolver = resolver; + } + #endregion + + #region Methods + /// + /// Resolves the template content with the specified name. + /// + /// The name of the template to resolve. + /// The template content. + public string Resolve(string name) + { + return _resolver(name); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/DynamicViewBag.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/DynamicViewBag.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,202 @@ +namespace RazorEngine.Templating +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Dynamic; + + /// + /// Defines a dynamic view bag. + /// + public class DynamicViewBag : DynamicObject + { + #region Fields + private readonly IDictionary _dict = new Dictionary(); + #endregion + + /// + /// Initialises a new instance of + /// + /// The parent view bag. + public DynamicViewBag(DynamicViewBag viewbag = null) + { + if (viewbag != null) + { + // Add the viewbag to the current dictionary. + foreach (var pair in viewbag._dict) + _dict.Add(pair); + } + } + + #region DynamicObject Overrides + + /// + /// Gets the set of dynamic member names. + /// + /// An instance of . + public override IEnumerable GetDynamicMemberNames() + { + return _dict.Keys; + } + + /// + /// Attempts to read a dynamic member from the object. + /// + /// The binder. + /// The result instance. + /// True, always. + public override bool TryGetMember(GetMemberBinder binder, out object result) + { + if (_dict.ContainsKey(binder.Name)) + result = _dict[binder.Name]; + else + result = null; + + return true; + } + + /// + /// Attempts to set a value on the object. + /// + /// The binder. + /// The value to set. + /// True, always. + public override bool TrySetMember(SetMemberBinder binder, object value) + { + if (_dict.ContainsKey(binder.Name)) + _dict[binder.Name] = value; + else + _dict.Add(binder.Name, value); + + return true; + } + + #endregion + + #region Helper Methods + + /// + /// Set a value in this instance of DynamicViewBag. + /// + /// + /// The property name through which this value can be get/set. + /// + /// + /// The value that will be assigned to this property name. + /// + public void SetValue(string propertyName, object value) + { + if (propertyName == null) + throw new ArgumentNullException("The propertyName parameter may not be NULL."); + + _dict[propertyName] = value; + } + + /// + /// Add a value to this instance of DynamicViewBag. + /// + /// + /// The property name through which this value can be get/set. + /// + /// + /// The value that will be assigned to this property name. + /// + public void AddValue(string propertyName, object value) + { + if (propertyName == null) + throw new ArgumentNullException("The propertyName parameter may not be NULL."); + + if (_dict.ContainsKey(propertyName) == true) + throw new ArgumentException("Attempt to add duplicate value for the '" + propertyName + "' property."); + + _dict.Add(propertyName, value); + } + + /// + /// Adds values from the specified valueList to this instance of DynamicViewBag. + /// + /// + /// A list of objects. Each must have a public property of keyPropertyName. + /// + /// + /// The property name that will be retrieved for each object in the specified valueList + /// and used as the key (property name) for the ViewBag. This property must be of type string. + /// + public void AddListValues(IList valueList, string keyPropertyName) + { + foreach (object value in valueList) + { + if (value == null) + throw new ArgumentNullException("Invalid NULL value in initializer list."); + + Type type = value.GetType(); + object objKey = type.GetProperty(keyPropertyName); + + if (objKey.GetType() != typeof(string)) + throw new ArgumentNullException("The keyPropertyName property must be of type string."); + + string strKey = (string)objKey; + + if (_dict.ContainsKey(strKey) == true) + throw new ArgumentException("Attempt to add duplicate value for the '" + strKey + "' property."); + + _dict.Add(strKey, value); + } + } + + /// + /// Adds values from the specified valueDictionary to this instance of DynamicViewBag. + /// + /// + /// A dictionary of objects. The Key of each item in the dictionary will be used + /// as the key (property name) for the ViewBag. + /// + public void AddDictionaryValues(IDictionary valueDictionary) + { + foreach (object objKey in valueDictionary.Keys) + { + if (objKey.GetType() != typeof(string)) + throw new ArgumentNullException("The Key in valueDictionary must be of type string."); + + string strKey = (string)objKey; + + if (_dict.ContainsKey(strKey) == true) + throw new ArgumentException("Attempt to add duplicate value for the '" + strKey + "' property."); + + object value = valueDictionary[strKey]; + + _dict.Add(strKey, value); + } + } + + /// + /// Adds values from the specified valueDictionary to this instance of DynamicViewBag. + /// + /// + /// A generic dictionary of {string, object} objects. The Key of each item in the + /// dictionary will be used as the key (property name) for the ViewBag. + /// + /// + /// This method was intentionally not overloaded from AddDictionaryValues due to an ambiguous + /// signature when the caller passes in a Dictionary<string, object> as the valueDictionary. + /// This is because the Dictionary<TK, TV>() class implements both IDictionary and IDictionary<TK, TV>. + /// A Dictionary<string, ???> (any other type than object) will resolve to AddDictionaryValues. + /// This is specifically for a generic List<string, object>, which does not resolve to + /// an IDictionary interface. + /// + public void AddDictionaryValuesEx(IDictionary valueDictionary) + { + foreach (string strKey in valueDictionary.Keys) + { + if (_dict.ContainsKey(strKey) == true) + throw new ArgumentException("Attempt to add duplicate value for the '" + strKey + "' property."); + + object value = valueDictionary[strKey]; + + _dict.Add(strKey, value); + } + } + + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/ExecuteContext.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/ExecuteContext.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,108 @@ +namespace RazorEngine.Templating +{ + using System; + using System.Collections.Generic; + using System.Dynamic; + using System.IO; + + /// + /// Defines a context for tracking template execution. + /// + public class ExecuteContext + { + #region Constructors + + /// + /// Creates a new instance of ExecuteContext with an empty ViewBag. + /// + public ExecuteContext() + { + _viewBag = new DynamicViewBag(); + } + + /// + /// Creates a new instance of DynamicViewBag, setting initial values in the ViewBag. + /// + /// The initial view bag data or NULL for an empty ViewBag. + public ExecuteContext(DynamicViewBag viewBag) + { + if (viewBag == null) + _viewBag = new DynamicViewBag(); + else + _viewBag = viewBag; + } + + #endregion + + #region Fields + private readonly IDictionary _definedSections = new Dictionary(); + private readonly Stack _bodyWriters = new Stack(); + private readonly dynamic _viewBag; + #endregion + + #region Properties + /// + /// Gets the current writer. + /// + //internal TextWriter CurrentWriter { get { return _writers.Peek(); } } + internal TextWriter CurrentWriter { get; set; } + + /// + /// Gets the viewbag that allows sharing state. + /// + public dynamic ViewBag { get { return _viewBag; } } + #endregion + + #region Methods + /// + /// Defines a section used in layouts. + /// + /// The name of the section. + /// The delegate action used to write the section at a later stage in the template execution. + public void DefineSection(string name, Action action) + { + if (string.IsNullOrWhiteSpace(name)) + throw new ArgumentException("A name is required to define a section."); + + if (_definedSections.ContainsKey(name)) + throw new ArgumentException("A section has already been defined with name '" + name + "'"); + + _definedSections.Add(name, action); + } + + /// + /// Gets the section delegate. + /// + /// The name of the section. + /// The section delegate. + public Action GetSectionDelegate(string name) + { + if (_definedSections.ContainsKey(name)) + return _definedSections[name]; + + return null; + } + + /// + /// Pops the template writer helper off the stack. + /// + /// The template writer helper. + internal TemplateWriter PopBody() + { + return _bodyWriters.Pop(); + } + + /// + /// Pushes the specified template writer helper onto the stack. + /// + /// The template writer helper. + internal void PushBody(TemplateWriter bodyWriter) + { + if (bodyWriter == null) + throw new ArgumentNullException("bodyWriter"); + + _bodyWriters.Push(bodyWriter); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/HtmlTemplateBaseOfT.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/HtmlTemplateBaseOfT.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,15 @@ +namespace RazorEngine.Templating +{ + using System.Diagnostics; + using System.IO; + + /// + /// Provides a base implementation of an html template with a model. + /// + /// + /// This type does not currently serve a purpose, and the WriteAttribute* API has been migrated to the TemplateBase type. This type is not deprecated, as it + /// may form the basis for a future template that supports MVC like @Html syntax. + /// + /// The model type. + public class HtmlTemplateBase : TemplateBase { } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/IActivator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/IActivator.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,17 @@ +namespace RazorEngine.Templating +{ + /// + /// Defines the required contract for implementing an activator. + /// + public interface IActivator + { + #region Methods + /// + /// Creates an instance of the specifed template. + /// + /// The instance context. + /// An instance of . + ITemplate CreateInstance(InstanceContext context); + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/IAppDomainFactory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/IAppDomainFactory.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,18 @@ +namespace RazorEngine.Templating +{ + using System; + + /// + /// Defines the required contract for implementing an factory. + /// + public interface IAppDomainFactory + { + #region Methods + /// + /// Creates the . + /// + /// The instance. + AppDomain CreateAppDomain(); + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/ITemplate.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/ITemplate.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,41 @@ +namespace RazorEngine.Templating +{ + /// + /// Defines the required contract for implementing a template. + /// + public interface ITemplate + { + #region Properties + /// + /// Sets the template service. + /// + ITemplateService TemplateService { set; } + #endregion + + #region Methods + /// + /// Executes the compiled template. + /// + void Execute(); + + /// + /// Runs the template and returns the result. + /// + /// The current execution context. + /// The merged result of the template. + string Run(ExecuteContext context); + + /// + /// Writes the specified object to the result. + /// + /// The value to write. + void Write(object value); + + /// + /// Writes the specified string to the result. + /// + /// The literal to write. + void WriteLiteral(string literal); + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/ITemplateOfT.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/ITemplateOfT.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,16 @@ +namespace RazorEngine.Templating +{ + /// + /// Defines the required contract for implementing a template with a model. + /// + /// The model type. + public interface ITemplate : ITemplate + { + #region Properties + /// + /// Gets the or sets the model. + /// + T Model { get; set; } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/ITemplateResolver.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/ITemplateResolver.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,17 @@ +namespace RazorEngine.Templating +{ + /// + /// Defines the required contract for implementing a template resolver. + /// + public interface ITemplateResolver + { + #region Methods + /// + /// Resolves the template content with the specified name. + /// + /// The name of the template to resolve. + /// The template content. + string Resolve(string name); + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/ITemplateService.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/ITemplateService.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,210 @@ +namespace RazorEngine.Templating +{ + using System; + using System.Collections.Generic; + + using Configuration; + using Text; + + /// + /// Defines the required contract for implementing a template service. + /// + public interface ITemplateService : IDisposable + { + #region Properties + /// + /// Gets the template service configuration. + /// + ITemplateServiceConfiguration Configuration { get; } + + /// + /// Gets the encoded string factory. + /// + IEncodedStringFactory EncodedStringFactory { get; } + #endregion + + #region Methods + /// + /// Adds a namespace that will be imported into the template. + /// + /// The namespace to be imported. + void AddNamespace(string ns); + + /// + /// Creates a new used to tracking templates. + /// + /// The view bag. + /// The instance of + ExecuteContext CreateExecuteContext(DynamicViewBag viewBag = null); + + /// + /// Compiles the specified template. + /// + /// The string template. + /// The model type. + /// The name of the template type in the cache. + void Compile(string razorTemplate, Type modelType, string cacheName); + + /// + /// Creates an instance of from the specified string template. + /// + /// + /// The string template. + /// If templateType is not NULL (precompiled template), this parameter may be NULL (unused). + /// + /// + /// The template type or NULL if the template type should be dynamically created. + /// If razorTemplate is not NULL, this parameter may be NULL (unused). + /// + /// The model instance or NULL if no model exists. + /// An instance of . + ITemplate CreateTemplate(string razorTemplate, Type templateType, object model); + + /// + /// Creates a set of templates from the specified string templates. + /// + /// + /// The set of templates to create or NULL if all template types are already created (see templateTypes). + /// If this parameter is NULL, the the templateTypes parameter may not be NULL. + /// Individual elements in this set may be NULL if the corresponding templateTypes[i] is not NULL (precompiled template). + /// + /// + /// The set of models or NULL if no models exist for all templates. + /// Individual elements in this set may be NULL if no model exists for a specific template. + /// + /// + /// The set of template types or NULL to dynamically create template types for each template. + /// If this parameter is NULL, the the razorTemplates parameter may not be NULL. + /// Individual elements in this set may be NULL to dynamically create the template if the corresponding razorTemplates[i] is not NULL (dynamically compile template). + /// + /// Flag to determine whether to create templates in parallel. + /// The enumerable set of template instances. + IEnumerable CreateTemplates(IEnumerable razorTemplates, IEnumerable templateTypes, IEnumerable models, bool parallel = false); + + /// + /// Creates a that can be used to instantiate an instance of a template. + /// + /// The string template. + /// The model type or NULL if no model exists. + /// An instance of . + Type CreateTemplateType(string razorTemplate, Type modelType); + + /// + /// Creates a set of template types from the specfied string templates. + /// + /// The set of templates to create instances for. + /// + /// The set of model types or NULL if no models exist for all templates. + /// Individual elements in this set may be NULL if no model exists for a specific template. + /// + /// Flag to determine whether to create template types in parallel. + /// The set of instances. + IEnumerable CreateTemplateTypes(IEnumerable razorTemplates, IEnumerable modelTypes, bool parallel = false); + + /// + /// Gets an instance of the template using the cached compiled type, or compiles the template type + /// if it does not exist in the cache. + /// + /// The string template. + /// The model or NULL if there is no model for this template. + /// The name of the template type in the cache. + /// An instance of . + ITemplate GetTemplate(string razorTemplate, object model, string cacheName); + + /// + /// Gets the set of template instances for the specified string templates. Cached templates will be considered + /// and if they do not exist, new types will be created and instantiated. + /// + /// The set of templates to create. + /// + /// The set of models or NULL if no models exist for all templates. + /// Individual elements in this set may be NULL if no model exists for a specific template. + /// + /// The set of cache names. + /// Flag to determine whether to get the templates in parallel. + /// The set of instances. + IEnumerable GetTemplates(IEnumerable razorTemplates, IEnumerable models, IEnumerable cacheNames, bool parallel = false); + + /// + /// Returns whether or not a template by the specified name has been created already. + /// + /// The name of the template type in cache. + /// Whether or not the template has been created. + bool HasTemplate(string cacheName); + + /// + /// Remove a template by the specified name from the cache. + /// + /// The name of the template type in cache. + /// Whether or not the template has been removed. + bool RemoveTemplate(string cacheName); + + /// + /// Parses and returns the result of the specified string template. + /// + /// The string template. + /// The model instance or NULL if no model exists. + /// The ViewBag contents or NULL for an initially empty ViewBag. + /// The name of the template type in the cache or NULL if no caching is desired. + /// The string result of the template. + string Parse(string razorTemplate, object model, DynamicViewBag viewBag, string cacheName); + + /// + /// Parses and returns the result of the specified string template. + /// + /// Type of the model. Used to find out the type of the model, if model is NULL + /// The string template. + /// The model instance or NULL if no model exists. + /// The ViewBag contents or NULL for an initially empty ViewBag. + /// The name of the template type in the cache or NULL if no caching is desired. + /// The string result of the template. + string Parse(string razorTemplate, object model, DynamicViewBag viewBag, string cacheName); + + /// + /// Parses the specified set of templates. + /// + /// The set of string templates to parse. + /// + /// The set of models or NULL if no models exist for all templates. + /// Individual elements in this set may be NULL if no model exists for a specific template. + /// + /// + /// The set of initial ViewBag contents or NULL for an initially empty ViewBag for all templates. + /// Individual elements in this set may be NULL if an initially empty ViewBag is desired for a specific template. + /// + /// + /// The set of cache names or NULL if no caching is desired for templates. + /// Individual elements in this set may be NULL if caching is not desired for a specific template. + /// + /// Flag to determine whether parsing in templates. + /// The set of parsed template results. + IEnumerable ParseMany(IEnumerable razorTemplates, IEnumerable models, IEnumerable viewBags, IEnumerable cacheNames, bool parallel); + + /// + /// Resolves the template with the specified name. + /// + /// The name of the template type in cache. + /// The model for the template. + /// The resolved template. + ITemplate Resolve(string cacheName, object model); + + /// + /// Runs the template with the specified cacheName. + /// + /// The name of the template in cache. The template must be in cache. + /// The model for the template or NULL if there is no model. + /// The initial ViewBag contents NULL for an empty ViewBag. + /// The string result of the template. + string Run(string cacheName, object model, DynamicViewBag viewBag); + + /// + /// Runs the specified template. + /// + /// The template to run. + /// The ViewBag contents or NULL for an initially empty ViewBag. + /// The string result of the template. + string Run(ITemplate template, DynamicViewBag viewBag); + + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/InstanceContext.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/InstanceContext.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,39 @@ +namespace RazorEngine.Templating +{ + using System; + using System.Diagnostics.Contracts; + + /// + /// Defines contextual information for a template instance. + /// + public class InstanceContext + { + #region Constructor + /// + /// Initialises a new instance of . + /// + /// The type loader. + /// The template type. + internal InstanceContext(TypeLoader loader, Type templateType) + { + Contract.Requires(loader != null); + Contract.Requires(templateType != null); + + Loader = loader; + TemplateType = templateType; + } + #endregion + + #region Properties + /// + /// Gets the type loader. + /// + public TypeLoader Loader { get; private set; } + + /// + /// Gets the template type. + /// + public Type TemplateType { get; private set; } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/IsolatedTemplateService.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/IsolatedTemplateService.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,493 @@ +namespace RazorEngine.Templating +{ + using System; + using System.Collections.Generic; + using System.Globalization; + using System.Reflection; + using System.Linq; + + using Compilation; + using Configuration; + using Text; + + /// + /// Provides template parsing and compilation in an isolated application domain. + /// + public class IsolatedTemplateService : ITemplateService + { + #region Fields + private static readonly Type TemplateServiceType = typeof(TemplateService); + private readonly ITemplateService _proxy; + private readonly AppDomain _appDomain; + private bool disposed; + #endregion + + #region Constructor + /// + /// Initialises a new instance of + /// + public IsolatedTemplateService() + : this(Language.CSharp, Encoding.Html, (IAppDomainFactory)null) { } + + /// + /// Initialises a new instance of + /// + /// The code language. + public IsolatedTemplateService(Language language) + : this(language, Encoding.Html, (IAppDomainFactory)null) { } + + /// + /// Initialises a new instance of + /// + /// The encoding. + public IsolatedTemplateService(Encoding encoding) + : this(Language.CSharp, encoding, (IAppDomainFactory)null) { } + + /// + /// Initialises a new instance of + /// + /// The application domain factory. + public IsolatedTemplateService(IAppDomainFactory appDomainFactory) + : this(Language.CSharp, Encoding.Html, appDomainFactory) { } + + /// + /// Initialises a new instance of . + /// + /// The delegate used to create an application domain. + public IsolatedTemplateService(Func appDomainFactory) + : this(Language.CSharp, Encoding.Html, appDomainFactory) { } + + /// + /// Initialises a new instance of + /// + /// The code language. + /// The encoding. + /// The application domain factory. + public IsolatedTemplateService(Language language, Encoding encoding, IAppDomainFactory appDomainFactory) + { + _appDomain = CreateAppDomain(appDomainFactory ?? new DefaultAppDomainFactory()); + + string assemblyName = TemplateServiceType.Assembly.FullName; + string typeName = TemplateServiceType.FullName; + + _proxy = (ITemplateService)_appDomain.CreateInstance( + assemblyName, typeName, false, BindingFlags.NonPublic | BindingFlags.Instance, + null, new object[] { language, encoding }, CultureInfo.CurrentCulture, null).Unwrap(); + } + + /// + /// Initialises a new instance of . + /// + /// The code language. + /// The delegate used to create an application domain. + public IsolatedTemplateService(Language language, Func appDomainFactory) + : this(language, Encoding.Html, new DelegateAppDomainFactory(appDomainFactory)) { } + + /// + /// Initialises a new instance of . + /// + /// The code language. + /// The encoding. + /// The delegate used to create an application domain. + public IsolatedTemplateService(Language language, Encoding encoding, Func appDomainFactory) + : this(language, encoding, new DelegateAppDomainFactory(appDomainFactory)) { } + + /// + /// Initialises a new instance of . + /// + /// The encoding. + /// The delegate used to create an application domain. + public IsolatedTemplateService(Encoding encoding, Func appDomainFactory) + : this(Language.CSharp, encoding, new DelegateAppDomainFactory(appDomainFactory)) { } + #endregion + + #region Properties + /// + /// Gets the template service configuration. + /// + ITemplateServiceConfiguration ITemplateService.Configuration { get { return null; } } + + /// + /// Gets the encoded string factory. + /// + IEncodedStringFactory ITemplateService.EncodedStringFactory { get { return null; } } + #endregion + + #region Methods + /// + /// Adds a namespace that will be imported into the template. + /// + /// The namespace to be imported. + public void AddNamespace(string ns) + { + _proxy.AddNamespace(ns); + } + + /// + /// Creates a new used to tracking templates. + /// + /// The view bag. + /// The instance of + ExecuteContext ITemplateService.CreateExecuteContext(DynamicViewBag viewBag = null) + { + throw new NotSupportedException("This operation is not supported directly by the IsolatedTemplateService."); + } + + /// + /// Compiles the specified template. + /// + /// The string template. + /// The model type. + /// The name of the template type in the cache. + public void Compile(string razorTemplate, Type modelType, string cacheName) + { + _proxy.Compile(razorTemplate, modelType, cacheName); + } + + /// + /// Creates an application domain. + /// + /// The application domain factory. + /// An instance of . + private static AppDomain CreateAppDomain(IAppDomainFactory factory) + { + var domain = factory.CreateAppDomain(); + if (domain == null) + throw new InvalidOperationException("The application domain factory did not create an application domain."); + + if (domain == AppDomain.CurrentDomain) + throw new InvalidOperationException("The application domain factory returned the current application domain which cannot be used for isolation."); + + return domain; + } + + /// + /// Creates an instance of from the specified string template. + /// + /// + /// The string template. + /// If templateType is not NULL, this parameter may be NULL (unused). + /// + /// + /// The template type or NULL if the template type should be dynamically created. + /// If razorTemplate is not NULL, this parameter may be NULL (unused). + /// + /// The model instance or NULL if no model exists. + /// An instance of . + public ITemplate CreateTemplate(string razorTemplate, Type templateType, object model) + { + if (disposed) + throw new ObjectDisposedException("IsolatedTemplateService"); + + if (model != null) + { + if (CompilerServicesUtility.IsDynamicType(model.GetType())) + throw new ArgumentException("IsolatedTemplateService instances do not support anonymous or dynamic types."); + } + + return _proxy.CreateTemplate(razorTemplate, templateType, model); + } + + /// + /// Creates a set of templates from the specified string templates and models. + /// + /// + /// The set of templates to create or NULL if all template types are already created (see templateTypes). + /// If this parameter is NULL, the the templateTypes parameter may not be NULL. + /// Individual elements in this set may be NULL if the corresponding templateTypes[i] is not NULL (precompiled template). + /// + /// + /// The set of models or NULL if no models exist for all templates. + /// Individual elements in this set may be NULL if no model exists for a specific template. + /// + /// + /// The set of template types or NULL to dynamically create template types for each template. + /// If this parameter is NULL, the the razorTemplates parameter may not be NULL. + /// Individual elements in this set may be NULL to dynamically create the template if the corresponding razorTemplates[i] is not NULL (dynamically compile template). + /// + /// Flag to determine whether to create templates in parallel. + /// The enumerable set of template instances. + public IEnumerable CreateTemplates(IEnumerable razorTemplates, IEnumerable templateTypes, IEnumerable models, bool parallel = false) + { + if (disposed) + throw new ObjectDisposedException("IsolatedTemplateService"); + + if (models != null) + { + foreach (object model in models) + { + if (model != null) + { + if (CompilerServicesUtility.IsDynamicType(model.GetType())) + throw new ArgumentException("IsolatedTemplateService instances do not support anonymous or dynamic types."); + } + } + } + + return _proxy.CreateTemplates(razorTemplates, templateTypes, models, parallel); + } + + /// + /// Creates a that can be used to instantiate an instance of a template. + /// + /// The string template. + /// The model type or NULL if no model exists. + /// An instance of . + public Type CreateTemplateType(string razorTemplate, Type modelType) + { + if (disposed) + throw new ObjectDisposedException("IsolatedTemplateService"); + + if (CompilerServicesUtility.IsDynamicType(modelType)) + throw new ArgumentException("IsolatedTemplateService instances do not support anonymous or dynamic types."); + + return _proxy.CreateTemplateType(razorTemplate, modelType); + } + + /// + /// Creates a set of template types from the specfied string templates. + /// + /// The set of templates to create instances for. + /// + /// The set of model types or NULL if no models exist for all templates. + /// Individual elements in this set may be NULL if no model exists for a specific template. + /// + /// Flag to determine whether to create template types in parallel. + /// The set of instances. + public IEnumerable CreateTemplateTypes(IEnumerable razorTemplates, IEnumerable modelTypes, bool parallel = false) + { + if (disposed) + throw new ObjectDisposedException("IsolatedTemplateService"); + + if (modelTypes != null) + { + foreach (Type modelType in modelTypes) + { + if ((modelType != null) && CompilerServicesUtility.IsDynamicType(modelType)) + throw new ArgumentException("IsolatedTemplateService instances do not support anonymous or dynamic types."); + } + } + + return _proxy.CreateTemplateTypes(razorTemplates, modelTypes, parallel); + } + + /// + /// Releases resources used by this instance. + /// + /// + /// This method ensures the AppDomain is unloaded and any template assemblies are unloaded with it. + /// + /// Flag to determine whether the instance is being disposed explicitly. + protected virtual void Dispose(bool disposing) + { + if (disposing && !disposed) + { + _proxy.Dispose(); + + AppDomain.Unload(_appDomain); + disposed = true; + } + } + + /// + /// Releases resources used by this instance. + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + /// Gets an instance of the template using the cached compiled type, or compiles the template type + /// if it does not exist in the cache. + /// + /// The string template. + /// The model or NULL if there is no model for this template. + /// The name of the template type in the cache. + /// An instance of . + public ITemplate GetTemplate(string razorTemplate, object model, string cacheName) + { + if (disposed) + throw new ObjectDisposedException("IsolatedTemplateService"); + + return _proxy.GetTemplate(razorTemplate, model, cacheName); + } + + /// + /// Gets the set of template instances for the specified string templates. Cached templates will be considered + /// and if they do not exist, new types will be created and instantiated. + /// + /// The set of templates to create. + /// + /// The set of models or NULL if no models exist for all templates. + /// Individual elements in this set may be NULL if no model exists for a specific template. + /// + /// The set of cache names. + /// Flag to determine whether to get the templates in parallel. + /// The set of instances. + public IEnumerable GetTemplates(IEnumerable razorTemplates, IEnumerable models, IEnumerable cacheNames, bool parallel = false) + { + if (disposed) + throw new ObjectDisposedException("IsolatedTemplateService"); + + if (models != null) + { + foreach (object model in models) + { + if (model != null) + { + if (CompilerServicesUtility.IsDynamicType(model.GetType())) + throw new ArgumentException("IsolatedTemplateService instances do not support anonymous or dynamic types."); + } + } + } + + return _proxy.GetTemplates(razorTemplates, models, cacheNames, parallel); + } + + /// + /// Returns whether or not a template by the specified name has been created already. + /// + /// The name of the template type in cache. + /// Whether or not the template has been created. + public bool HasTemplate(string cacheName) + { + return _proxy.HasTemplate(cacheName); + } + + /// + /// Remove a template by the specified name from the cache. + /// + /// The name of the template type in cache. + /// Whether or not the template has been removed. + public bool RemoveTemplate(string cacheName) + { + return _proxy.RemoveTemplate(cacheName); + } + + /// + /// Parses and returns the result of the specified string template. + /// + /// The string template. + /// The model instance or NULL if no model exists. + /// The ViewBag contents or NULL for an initially empty ViewBag. + /// The name of the template type in the cache or NULL if no caching is desired. + /// The string result of the template. + public string Parse(string razorTemplate, object model, DynamicViewBag viewBag, string cacheName) + { + if (disposed) + throw new ObjectDisposedException("IsolatedTemplateService"); + + if (model != null) + { + if (CompilerServicesUtility.IsDynamicType(model.GetType())) + throw new ArgumentException("IsolatedTemplateService instances do not support anonymous or dynamic types."); + } + + return _proxy.Parse(razorTemplate, model, viewBag, cacheName); + } + + /// + /// Parses and returns the result of the specified string template. + /// + /// The string template. + /// The model instance or NULL if no model exists. + /// The ViewBag contents or NULL for an initially empty ViewBag. + /// The name of the template type in the cache or NULL if no caching is desired. + /// The string result of the template. + public string Parse(string razorTemplate, object model, DynamicViewBag viewBag, string cacheName) + { + if (disposed) + throw new ObjectDisposedException("IsolatedTemplateService"); + + if (model != null) + { + if (CompilerServicesUtility.IsDynamicType(model.GetType())) + throw new ArgumentException("IsolatedTemplateService instances do not support anonymous or dynamic types."); + } + + return _proxy.Parse(razorTemplate, model, viewBag, cacheName); + } + + /// + /// Parses the specified set of templates. + /// + /// The set of string templates to parse. + /// + /// The set of models or NULL if no models exist for all templates. + /// Individual elements in this set may be NULL if no model exists for a specific template. + /// + /// + /// The set of initial ViewBag contents or NULL for an initially empty ViewBag for all templates. + /// Individual elements in this set may be NULL if an initially empty ViewBag is desired for a specific template. + /// + /// + /// The set of cache names or NULL if no caching is desired for all templates. + /// Individual elements in this set may be NULL if caching is not desired for specific template. + /// + /// Flag to determine whether parsing in templates. + /// The set of parsed template results. + public IEnumerable ParseMany(IEnumerable razorTemplates, IEnumerable models, IEnumerable viewBags, IEnumerable cacheNames, bool parallel) + { + if (disposed) + throw new ObjectDisposedException("IsolatedTemplateService"); + + if ((models != null) && (models.Count() != razorTemplates.Count())) + throw new ArgumentException("Expected same number of models contents as templates to be processed."); + + if ((viewBags != null) && (viewBags.Count() != razorTemplates.Count())) + throw new ArgumentException("Expected same number of ViewBag contents as templates to be processed."); + + if ((cacheNames != null) && (cacheNames.Count() != razorTemplates.Count())) + throw new ArgumentException("Expected same number of cache names as templates to be processed."); + + if (models != null) + { + foreach (object model in models) + { + if ((model != null) && CompilerServicesUtility.IsDynamicType(model.GetType())) + throw new ArgumentException("IsolatedTemplateService instances do not support anonymous or dynamic types."); + } + } + + return _proxy.ParseMany(razorTemplates, models, viewBags, cacheNames, parallel).ToList(); + } + + /// + /// Resolves the template with the specified name. + /// + /// The name of the template type in cache. + /// The model or NULL if there is no model for the template. + /// The resolved template. + public ITemplate Resolve(string cacheName, object model) + { + return _proxy.Resolve(cacheName, model); + } + + /// + /// Runs the template with the specified cacheName. + /// + /// The name of the template in cache. The template must be in cache. + /// The model for the template or NULL if there is no model. + /// The initial ViewBag contents NULL for an empty ViewBag. + /// The string result of the template. + public string Run(string cacheName, object model, DynamicViewBag viewBag) + { + return _proxy.Run(cacheName, model, viewBag); + } + + /// + /// Runs the template with the specified name. + /// + /// The template to run. + /// The ViewBag contents or NULL for an initially empty ViewBag. + /// The string result of the template. + public string Run(ITemplate template, DynamicViewBag viewBag) + { + return _proxy.Run(template, viewBag); + } + + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/Parallel/DefaultParallelQueryPlan.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/Parallel/DefaultParallelQueryPlan.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,28 @@ +namespace RazorEngine.Templating.Parallel +{ + using System.Collections.Generic; + using System.Linq; + + /// + /// Represents a default parallel query plan. + /// + /// + /// The uses the default + /// result. The degree of parallelism by default is Math.Min(ProcessorCount, 64). + /// + /// The item type. + public class DefaultParallelQueryPlan : IParallelQueryPlan + { + #region Methods + /// + /// Creates a parallel query for the specified source. + /// + /// The source enumerable. + /// The parallel query. + public ParallelQuery CreateQuery(IEnumerable source) + { + return source.AsParallel().AsOrdered(); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/Parallel/IParallelQueryPlan.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/Parallel/IParallelQueryPlan.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,21 @@ +namespace RazorEngine.Templating.Parallel +{ + using System.Collections.Generic; + using System.Linq; + + /// + /// Defines the required contract for implementing a parallel query plan. + /// + /// The item type. + public interface IParallelQueryPlan + { + #region Methods + /// + /// Creates a parallel query for the specified source. + /// + /// The source enumerable. + /// The parallel query. + ParallelQuery CreateQuery(IEnumerable source); + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/RequireNamespacesAttribute.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/RequireNamespacesAttribute.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,38 @@ +namespace RazorEngine.Templating +{ + using System; + using System.Collections.Generic; + + /// + /// Allows base templates to define require template imports when + /// generating templates. + /// + [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] + public sealed class RequireNamespacesAttribute : Attribute + { + #region Constructor + /// + /// Initialises a new instance of . + /// + /// The set of required namespace imports. + public RequireNamespacesAttribute(params string[] namespaces) + { + if (namespaces == null) + throw new ArgumentNullException("namespaces"); + + var set = new HashSet(); + foreach (string ns in namespaces) + set.Add(ns); + + Namespaces = set; + } + #endregion + + #region Properties + /// + /// Gets the set of required namespace imports. + /// + public IEnumerable Namespaces { get; private set; } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/TemplateBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/TemplateBase.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,365 @@ +namespace RazorEngine.Templating +{ + using System; + using System.Diagnostics; + using System.Diagnostics.Contracts; + using System.IO; + using System.Text; + + using Text; + + /// + /// Provides a base implementation of a template. + /// + public abstract class TemplateBase : MarshalByRefObject, ITemplate + { + #region Fields + protected ExecuteContext _context; + #endregion + + #region Constructor + /// + /// Initialises a new instance of . + /// + protected TemplateBase() { } + #endregion + + #region Properties + /// + /// Gets or sets the layout template name. + /// + public string Layout { get; set; } + + /// + /// Gets or sets the template service. + /// + public ITemplateService TemplateService { get; set; } + + /// + /// Gets the viewbag that allows sharing state between layout and child templates. + /// + public dynamic ViewBag { get { return _context.ViewBag; } } + + /// + /// Gets the current writer. + /// + public TextWriter CurrentWriter { get { return _context.CurrentWriter; } } + #endregion + + #region Methods + /// + /// Defines a section that can written out to a layout. + /// + /// The name of the section. + /// The delegate used to write the section. + public void DefineSection(string name, Action action) + { + _context.DefineSection(name, action); + } + + /// + /// Includes the template with the specified name. + /// + /// The name of the template type in cache. + /// The model or NULL if there is no model for the template. + /// The template writer helper. + public virtual TemplateWriter Include(string cacheName, object model = null) + { + var instance = TemplateService.Resolve(cacheName, model); + if (instance == null) + throw new ArgumentException("No template could be resolved with name '" + cacheName + "'"); + + return new TemplateWriter(tw => + tw.Write(instance.Run( + TemplateService.CreateExecuteContext(ViewBag)))); + } + + /// + /// Determines if the section with the specified name has been defined. + /// + /// The section name. + /// + public virtual bool IsSectionDefined(string name) + { + if (string.IsNullOrWhiteSpace(name)) + throw new ArgumentException("The name of the section to render must be specified."); + + return (_context.GetSectionDelegate(name) != null); + } + + /// + /// Executes the compiled template. + /// + public virtual void Execute() { } + + /// + /// Returns the specified string as a raw string. This will ensure it is not encoded. + /// + /// The raw string to write. + /// An instance of . + public IEncodedString Raw(string rawString) + { + return new RawString(rawString); + } + + /// + /// Resolves the layout template. + /// + /// The name of the layout template. + /// An instance of . + protected virtual ITemplate ResolveLayout(string name) + { + return TemplateService.Resolve(name, null); + } + + /// + /// Runs the template and returns the result. + /// + /// The current execution context. + /// The merged result of the template. + string ITemplate.Run(ExecuteContext context) + { + _context = context; + + var builder = new StringBuilder(); + using (var writer = new StringWriter(builder)) + { + _context.CurrentWriter = writer; + Execute(); + _context.CurrentWriter = null; + } + + if (Layout != null) + { + // Get the layout template. + var layout = ResolveLayout(Layout); + + if (layout == null) + { + throw new ArgumentException("Template you are trying to run uses layout, but no layout found in cache or by resolver."); + } + + // Push the current body instance onto the stack for later execution. + var body = new TemplateWriter(tw => tw.Write(builder.ToString())); + context.PushBody(body); + + return layout.Run(context); + } + + return builder.ToString(); + } + + /// + /// Renders the section with the specified name. + /// + /// The name of the section. + /// Flag to specify whether the section is required. + /// The template writer helper. + public virtual TemplateWriter RenderSection(string name, bool isRequired = true) + { + if (string.IsNullOrWhiteSpace(name)) + throw new ArgumentException("The name of the section to render must be specified."); + + var action = _context.GetSectionDelegate(name); + if (action == null && isRequired) + throw new ArgumentException("No section has been defined with name '" + name + "'"); + + if (action == null) action = () => { }; + + return new TemplateWriter(tw => action()); + } + + /// + /// Renders the body of the template. + /// + /// The template writer helper. + public TemplateWriter RenderBody() + { + return _context.PopBody(); + } + + /// + /// Writes the specified object to the result. + /// + /// The value to write. + public virtual void Write(object value) + { + WriteTo(_context.CurrentWriter, value); + } + + /// + /// Writes the specified template helper result. + /// + /// The template writer helper. + public virtual void Write(TemplateWriter helper) + { + if (helper == null) + return; + + helper.WriteTo(_context.CurrentWriter); + } + + /// + /// Writes an attribute to the result. + /// + /// The name of the attribute. + public virtual void WriteAttribute(string name, PositionTagged prefix, PositionTagged suffix, params AttributeValue[] values) + { + WriteAttributeTo(CurrentWriter, name, prefix, suffix, values); + } + + /// + /// Writes an attribute to the specified . + /// + /// The writer. + /// The name of the attribute to be written. + public virtual void WriteAttributeTo(TextWriter writer, string name, PositionTagged prefix, PositionTagged suffix, params AttributeValue[] values) + { + bool first = true; + bool wroteSomething = false; + if (values.Length == 0) + { + // Explicitly empty attribute, so write the prefix and suffix + WritePositionTaggedLiteral(writer, prefix); + WritePositionTaggedLiteral(writer, suffix); + } + else + { + for (int i = 0; i < values.Length; i++) + { + AttributeValue attrVal = values[i]; + PositionTagged val = attrVal.Value; + + bool? boolVal = null; + if (val.Value is bool) + { + boolVal = (bool)val.Value; + } + + if (val.Value != null && (boolVal == null || boolVal.Value)) + { + string valStr = val.Value as string; + if (valStr == null) + { + valStr = val.Value.ToString(); + } + if (boolVal != null) + { + Debug.Assert(boolVal.Value); + valStr = name; + } + + if (first) + { + WritePositionTaggedLiteral(writer, prefix); + first = false; + } + else + { + WritePositionTaggedLiteral(writer, attrVal.Prefix); + } + + if (attrVal.Literal) + { + WriteLiteralTo(writer, valStr); + } + else + { + WriteTo(writer, valStr); // Write value + } + wroteSomething = true; + } + } + if (wroteSomething) + { + WritePositionTaggedLiteral(writer, suffix); + } + } + } + + /// + /// Writes the specified string to the result. + /// + /// The literal to write. + public virtual void WriteLiteral(string literal) + { + WriteLiteralTo(_context.CurrentWriter, literal); + } + + /// + /// Writes a string literal to the specified . + /// + /// The writer. + /// The literal to be written. + public virtual void WriteLiteralTo(TextWriter writer, string literal) + { + if (writer == null) + throw new ArgumentNullException("writer"); + + if (literal == null) return; + writer.Write(literal); + } + + /// + /// Writes a literal to the result. + /// + /// The writer. + /// The literal to be written. + private void WritePositionTaggedLiteral(TextWriter writer, PositionTagged value) + { + WriteLiteralTo(writer, value.Value); + } + + /// + /// Writes the specified object to the specified . + /// + /// The writer. + /// The value to be written. + public virtual void WriteTo(TextWriter writer, object value) + { + if (writer == null) + throw new ArgumentNullException("writer"); + + if (value == null) return; + + var encodedString = value as IEncodedString; + if (encodedString != null) + { + writer.Write(encodedString); + } + else + { + encodedString = TemplateService.EncodedStringFactory.CreateEncodedString(value); + _context.CurrentWriter.Write(encodedString); + } + } + + /// + /// Writes the specfied template helper result to the specified writer. + /// + /// The writer. + /// The template writer helper. + public virtual void WriteTo(TextWriter writer, TemplateWriter helper) + { + if (helper == null) return; + + helper.WriteTo(writer); + } + + /// + /// Resolves the specified path + /// + /// The path. + /// The resolved path. + public virtual string ResolveUrl(string path) + { + // TODO: Actually resolve the url + if (path.StartsWith("~")) + { + path = path.Substring(1); + } + return path; + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/TemplateBaseOfT.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/TemplateBaseOfT.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,82 @@ +namespace RazorEngine.Templating +{ + using System.Dynamic; + + using Compilation; + + /// + /// Provides a base implementation of a template with a model. + /// + /// The model type. + public class TemplateBase : TemplateBase, ITemplate + { + #region Fields + + private object currentModel; + + #endregion + + #region Constructor + + /// + /// Initialises a new instance of . + /// + protected TemplateBase() + { + HasDynamicModel = GetType().IsDefined(typeof (HasDynamicModelAttribute), true); + } + + #endregion + + #region Properties + + /// + /// Determines whether this template has a dynamic model. + /// + protected bool HasDynamicModel { get; private set; } + + /// + /// Gets or sets the model. + /// + public T Model + { + get { return (T)currentModel; } + set + { + if (HasDynamicModel && !(value is DynamicObject) && !(value is ExpandoObject)) + currentModel = new RazorDynamicObject + { + Model = value, + AllowMissingPropertiesOnDynamic = TemplateService.Configuration.AllowMissingPropertiesOnDynamic + }; + else + currentModel = value; + } + } + + #endregion + + /// + /// Includes the template with the specified name. + /// + /// The name of the template type in cache. + /// The model or NULL if there is no model for the template. + /// The template writer helper. + public override TemplateWriter Include(string cacheName, object model = null) + { + return base.Include(cacheName, model ?? Model); + } + + #region Methods + /// + /// Resolves the layout template. + /// + /// The name of the layout template. + /// An instance of . + protected override ITemplate ResolveLayout(string name) + { + return TemplateService.Resolve(name, (T)currentModel); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/TemplateCompilationException.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/TemplateCompilationException.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,94 @@ +namespace RazorEngine.Templating +{ + using System; + using System.CodeDom.Compiler; + using System.Collections.Generic; + using System.Collections.ObjectModel; + using System.Diagnostics.CodeAnalysis; + using System.Linq; + using System.Runtime.Serialization; + + /// + /// Defines an exception that occurs during compilation of the template. + /// + [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors"), Serializable] + public class TemplateCompilationException : Exception + { + #region Constructors + /// + /// Initialises a new instance of . + /// + /// The set of compiler errors. + /// The source code that wasn't compiled. + /// The source template that wasn't compiled. + internal TemplateCompilationException(CompilerErrorCollection errors, string sourceCode, string template) + : base("Unable to compile template. " + errors[0].ErrorText + "\n\nOther compilation errors may have occurred. Check the Errors property for more information.") + { + var list = errors.Cast().ToList(); + Errors = new ReadOnlyCollection(list); + SourceCode = sourceCode; + Template = template; + } + + /// + /// Initialises a new instance of from serialised data. + /// + /// The serialisation info. + /// The streaming context. + protected TemplateCompilationException(SerializationInfo info, StreamingContext context) : base(info, context) + { + int count = info.GetInt32("Count"); + + var list = new List(); + var type = typeof(CompilerError); + + for (int i = 0; i < count; i++) + { + list.Add((CompilerError)info.GetValue("Errors[" + i + "]", type)); + } + + Errors = new ReadOnlyCollection(list); + + SourceCode = info.GetString("SourceCode"); + Template = info.GetString("Template"); + } + #endregion + + #region Properties + /// + /// Gets the set of compiler errors. + /// + public ReadOnlyCollection Errors { get; private set; } + + /// + /// Gets the source code that wasn't compiled. + /// + public string SourceCode { get; private set; } + + /// + /// Gets the source template that wasn't compiled. + /// + public string Template { get; private set; } + #endregion + + #region Methods + /// + /// Gets the object data for serialisation. + /// + /// The serialisation info. + /// The streaming context. + public override void GetObjectData(SerializationInfo info, StreamingContext context) + { + base.GetObjectData(info, context); + + info.AddValue("Count", Errors.Count); + + for (int i = 0; i < Errors.Count; i++) + info.AddValue("Errors[" + i + "]", Errors[i]); + + info.AddValue("SourceCode", SourceCode ?? string.Empty); + info.AddValue("Template", Template ?? string.Empty); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/TemplateParsingException.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/TemplateParsingException.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,65 @@ +namespace RazorEngine.Templating +{ + using System; + using System.Diagnostics.CodeAnalysis; + using System.Runtime.Serialization; + using System.Web.Razor.Parser.SyntaxTree; + + /// + /// Defines an exception that occurs during template parsing. + /// + [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors"), Serializable] + public class TemplateParsingException : Exception + { + #region Constructors + /// + /// Initialises a new instance of . + /// + /// The generated by the parser. + internal TemplateParsingException(RazorError error) + : base(error.Message) + { + Column = error.Location.CharacterIndex; + Line = error.Location.LineIndex; + } + + /// + /// Initialises a new instance of from serialised data. + /// + /// The serialisation info. + /// The streaming context. + protected TemplateParsingException(SerializationInfo info, StreamingContext context) : base(info, context) + { + Column = info.GetInt32("Column"); + Line = info.GetInt32("Line"); + } + #endregion + + #region Properties + /// + /// Gets the column the parsing error occured. + /// + public int Column { get; private set; } + + /// + /// Gets the line the parsing error occured. + /// + public int Line { get; private set; } + #endregion + + #region Methods + /// + /// Gets the object data for serialisation. + /// + /// The serialisation info. + /// The streaming context. + public override void GetObjectData(SerializationInfo info, StreamingContext context) + { + base.GetObjectData(info, context); + + info.AddValue("Column", Column); + info.AddValue("Line", Line); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/TemplateService.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/TemplateService.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,677 @@ +using System.Runtime.Remoting.Contexts; + +namespace RazorEngine.Templating +{ + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Diagnostics.Contracts; + using System.Linq; + using System.Reflection; + + using Compilation; + using Compilation.Inspectors; + using Configuration; + using Parallel; + using Text; + + /// + /// Defines a template service. + /// + public class TemplateService : MarshalByRefObject, ITemplateService + { + #region Fields + private readonly ITemplateServiceConfiguration _config; + + private readonly ConcurrentDictionary _cache = new ConcurrentDictionary(); + private readonly ConcurrentBag _assemblies = new ConcurrentBag(); + + private readonly TypeLoader _loader; + private static readonly Type _objectType = typeof(object); + + private bool disposed; + #endregion + + #region Constructor + /// + /// Initialises a new instance of + /// + /// The template service configuration. + public TemplateService(ITemplateServiceConfiguration config) + { + Contract.Requires(config != null); + + _config = config; + _loader = new TypeLoader(AppDomain.CurrentDomain, _assemblies); + } + + /// + /// Initialises a new instance of . + /// + public TemplateService() + : this(new TemplateServiceConfiguration()) { } + + /// + /// Initialises a new instance of + /// + /// The code language. + /// the encoding. + internal TemplateService(Language language, Encoding encoding) + : this(new TemplateServiceConfiguration() { Language = language, EncodedStringFactory = GetEncodedStringFactory(encoding) }) { } + #endregion + + #region Properties + /// + /// Gets the template service configuration. + /// + public ITemplateServiceConfiguration Configuration { get { return _config; } } + + /// + /// Gets the encoded string factory. + /// + public IEncodedStringFactory EncodedStringFactory { get { return _config.EncodedStringFactory; } } + #endregion + + #region Methods + /// + /// Adds a namespace that will be imported into the template. + /// + /// The namespace to be imported. + public void AddNamespace(string ns) + { + _config.Namespaces.Add(ns); + } + + /// + /// Compiles the specified template. + /// + /// The string template. + /// The model type. + /// The name of the template type in the cache. + public void Compile(string razorTemplate, Type modelType, string cacheName) + { + Contract.Requires(razorTemplate != null); + Contract.Requires(cacheName != null); + + int hashCode = razorTemplate.GetHashCode(); + + Type type = CreateTemplateType(razorTemplate, modelType); + var item = new CachedTemplateItem(hashCode, type); + + _cache.AddOrUpdate(cacheName, item, (n, i) => item); + } + + /// + /// Creates a new for tracking templates. + /// + /// The dynamic view bag. + /// The execute context. + public virtual ExecuteContext CreateExecuteContext(DynamicViewBag viewBag = null) + { + var context = new ExecuteContext(new DynamicViewBag(viewBag)); + + return context; + } + + /// + /// Creates a new for creating template instances. + /// + /// The template type. + /// An instance of . + [Pure] + protected virtual InstanceContext CreateInstanceContext(Type templateType) + { + return new InstanceContext(_loader, templateType); + } + + /// + /// Creates an instance of from the specified string template. + /// + /// + /// The string template. + /// If templateType is not NULL, this parameter may be NULL (unused). + /// + /// + /// The template type or NULL if the template type should be dynamically created. + /// If razorTemplate is not NULL, this parameter may be NULL (unused). + /// + /// The model instance or NULL if no model exists. + /// An instance of . + [Pure] + public virtual ITemplate CreateTemplate(string razorTemplate, Type templateType, object model) + { + if (templateType == null) + { + Type modelType = (model == null) ? typeof(object) : model.GetType(); + templateType = CreateTemplateType(razorTemplate, modelType); + } + + var context = CreateInstanceContext(templateType); + ITemplate instance = _config.Activator.CreateInstance(context); + instance.TemplateService = this; + + SetModel(instance, model); + + return instance; + } + + /// + /// Creates a set of templates from the specified string templates and models. + /// + /// + /// The set of templates to create or NULL if all template types are already created (see templateTypes). + /// If this parameter is NULL, the the templateTypes parameter may not be NULL. + /// Individual elements in this set may be NULL if the corresponding templateTypes[i] is not NULL (precompiled template). + /// + /// + /// The set of models or NULL if no models exist for all templates. + /// Individual elements in this set may be NULL if no model exists for a specific template. + /// + /// + /// The set of template types or NULL to dynamically create template types for each template. + /// If this parameter is NULL, the the razorTemplates parameter may not be NULL. + /// Individual elements in this set may be NULL to dynamically create the template if the corresponding razorTemplates[i] is not NULL (dynamically compile template). + /// + /// Flag to determine whether to create templates in parallel. + /// The enumerable set of template instances. + [Pure] + public virtual IEnumerable CreateTemplates(IEnumerable razorTemplates, IEnumerable templateTypes, IEnumerable models, bool parallel = false) + { + if ((razorTemplates == null) && (templateTypes == null)) + throw new ArgumentException("The razorTemplates and templateTypes parameters may not both be null."); + + List razorTemplateList = (razorTemplates == null) ? null : razorTemplates.ToList(); + List modelList = (models == null) ? null : models.ToList(); + List templateTypeList = (templateTypes == null) ? null : templateTypes.ToList(); + + int templateCount = (razorTemplateList != null) ? razorTemplateList.Count() : templateTypeList.Count(); + + if ((razorTemplateList != null) && (razorTemplateList.Count != templateTypeList.Count)) + throw new ArgumentException("Expected the same number of templateTypes as razorTemplates to be processed."); + + if ((templateTypeList != null) && (templateTypeList.Count != templateCount)) + throw new ArgumentException("Expected the same number of templateTypes as the number of templates to be processed."); + + if ((modelList != null) && (modelList.Count != templateCount)) + throw new ArgumentException("Expected the same number of models as the number of templates to be processed."); + + if ((razorTemplateList != null) && (templateTypeList != null)) + { + for (int i = 0; (i < templateCount); i++) + { + if (razorTemplateList == null) + { + if (templateTypeList[i] == null) + throw new ArgumentException("Expected non-NULL value in templateTypes[" + i.ToString() + "]."); + } + else if (templateTypeList == null) + { + if (razorTemplateList[i] == null) + throw new ArgumentException("Expected non-NULL value in either razorTemplates[" + i.ToString() + "]."); + } + else + { + if ((razorTemplateList[i] == null) && (templateTypeList[i] == null)) + throw new ArgumentException("Expected non-NULL value in either razorTemplates[" + i.ToString() + "] or templateTypes[" + i.ToString() + "]."); + } + } + } + + if (parallel) + { + if (razorTemplateList != null) + return GetParallelQueryPlan() + .CreateQuery(razorTemplates) + .Select((rt, i) => CreateTemplate( + rt, + (templateTypeList == null) ? null : templateTypeList[i], + (modelList == null) ? null : modelList[i])); + else + return GetParallelQueryPlan() + .CreateQuery(templateTypes) + .Select((tt, i) => CreateTemplate( + (razorTemplateList == null) ? null : razorTemplateList[i], + tt, + (modelList == null) ? null : modelList[i])); + } + + if (razorTemplateList != null) + return razorTemplates.Select((rt, i) => CreateTemplate( + rt, + (templateTypeList == null) ? null : templateTypeList[i], + (modelList == null) ? null : modelList[i])); + else + return templateTypeList.Select((tt, i) => CreateTemplate( + (razorTemplateList == null) ? null : razorTemplateList[i], + tt, + (modelList == null) ? null : modelList[i])); + } + + /// + /// Creates a that can be used to instantiate an instance of a template. + /// + /// The string template. + /// The model type or NULL if no model exists. + /// An instance of . + [Pure] + public virtual Type CreateTemplateType(string razorTemplate, Type modelType) + { + var context = new TypeContext + { + ModelType = (modelType == null) ? typeof(object) : modelType, + TemplateContent = razorTemplate, + TemplateType = (_config.BaseTemplateType) ?? typeof(TemplateBase<>) + }; + + foreach (string ns in _config.Namespaces) + context.Namespaces.Add(ns); + + var service = _config + .CompilerServiceFactory + .CreateCompilerService(_config.Language); + service.Debug = _config.Debug; + service.CodeInspectors = _config.CodeInspectors ?? Enumerable.Empty(); + + var result = service.CompileType(context); + + _assemblies.Add(result.Item2); + + return result.Item1; + } + + /// + /// Creates a set of template types from the specfied string templates. + /// + /// The set of templates to create instances for. + /// + /// The set of model types or NULL if no models exist for all templates. + /// Individual elements in this set may be NULL if no model exists for a specific template. + /// + /// Flag to determine whether to create template types in parallel. + /// The set of instances. + [Pure] + public virtual IEnumerable CreateTemplateTypes(IEnumerable razorTemplates, IEnumerable modelTypes, bool parallel = false) + { + Contract.Requires(razorTemplates != null); + + List modelTypeList = (modelTypes == null) ? null : modelTypes.ToList(); + + if (parallel) + return GetParallelQueryPlan() + .CreateQuery(razorTemplates) + .Select((t, i) => CreateTemplateType(t, + (modelTypeList == null) ? null : modelTypeList[i])); + + return razorTemplates.Select((t, i) => CreateTemplateType(t, + (modelTypeList == null) ? null : modelTypeList[i])); + } + + /// + /// Releases managed resources used by this instance. + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + /// Releases managed resources used by this instance. + /// + /// Are we explicitly disposing of this instance? + protected virtual void Dispose(bool disposing) + { + if (!disposed && disposing) + { + _loader.Dispose(); + disposed = true; + } + } + + /// + /// Gets an instance of a for a known encoding. + /// + /// The encoding to get a factory for. + /// An instance of + internal static IEncodedStringFactory GetEncodedStringFactory(Encoding encoding) + { + switch (encoding) + { + case Encoding.Html: + return new HtmlEncodedStringFactory(); + + case Encoding.Raw: + return new RawStringFactory(); + + default: + throw new ArgumentException("Unsupported encoding: " + encoding); + } + } + + /// + /// Gets a parellel query plan used to configure a parallel query. + /// + /// The query item type. + /// An instance of . + protected virtual IParallelQueryPlan GetParallelQueryPlan() + { + return new DefaultParallelQueryPlan(); + } + + /// + /// Gets an instance of the template using the cached compiled type, or compiles the template type + /// if it does not exist in the cache. + /// + /// The string template. + /// The model instance or NULL if there is no model for this template. + /// The name of the template type in the cache. + /// An instance of . + public virtual ITemplate GetTemplate(string razorTemplate, object model, string cacheName) + { + return this.GetTemplate(razorTemplate, model, cacheName); + } + + /// + /// Gets an instance of the template using the cached compiled type, or compiles the template type + /// if it does not exist in the cache. + /// + /// Type of the model + /// The string template. + /// The model instance or NULL if there is no model for this template. + /// The name of the template type in the cache. + /// An instance of . + private ITemplate GetTemplate(string razorTemplate, object model, string cacheName) + { + if (razorTemplate == null) + throw new ArgumentNullException("razorTemplate"); + + int hashCode = razorTemplate.GetHashCode(); + + CachedTemplateItem item; + if (!(_cache.TryGetValue(cacheName, out item) && item.CachedHashCode == hashCode)) + { + Type type = CreateTemplateType(razorTemplate, (model == null) ? typeof(T) : model.GetType()); + item = new CachedTemplateItem(hashCode, type); + + _cache.AddOrUpdate(cacheName, item, (n, i) => item); + } + + var instance = CreateTemplate(null, item.TemplateType, model); + return instance; + } + + /// + /// Gets the set of template instances for the specified string templates. Cached templates will be considered + /// and if they do not exist, new types will be created and instantiated. + /// + /// The set of templates to create. + /// + /// The set of models or NULL if no models exist for all templates. + /// Individual elements in this set may be NULL if no model exists for a specific template. + /// + /// The set of cache names. + /// Flag to determine whether to get the templates in parallel. + /// The set of instances. + public virtual IEnumerable GetTemplates(IEnumerable razorTemplates, IEnumerable models, IEnumerable cacheNames, bool parallel = false) + { + Contract.Requires(razorTemplates != null); + Contract.Requires(cacheNames != null); + Contract.Requires(razorTemplates.Count() == models.Count(), + "Expected same number of models as string templates to be processed."); + Contract.Requires(razorTemplates.Count() == cacheNames.Count(), + "Expected same number of cache names as string templates to be processed."); + + var modelList = (models == null) ? null : models.ToList(); + var cacheNameList = cacheNames.ToList(); + + if (parallel) + return GetParallelQueryPlan() + .CreateQuery(razorTemplates) + .Select((t, i) => GetTemplate(t, + (modelList == null) ? null : modelList[i], + cacheNameList[i])); + + return razorTemplates.Select((t, i) => GetTemplate(t, + (modelList == null) ? null : modelList[i], + cacheNameList[i])); + } + + + /// + /// Parses and returns the result of the specified string template. + /// + /// The string template. + /// The model instance or NULL if no model exists. + /// The ViewBag contents or NULL for an initially empty ViewBag. + /// The name of the template type in the cache or NULL if no caching is desired. + /// The string result of the template. + [Pure] + public virtual string Parse(string razorTemplate, object model, DynamicViewBag viewBag, string cacheName) + { + ITemplate instance; + + if (cacheName == null) + instance = CreateTemplate(razorTemplate, null, model); + else + instance = GetTemplate(razorTemplate, model, cacheName); + + return Run(instance, viewBag); + } + + + /// + /// Parses and returns the result of the specified string template. + /// + /// The string template. + /// The model instance or NULL if no model exists. + /// The ViewBag contents or NULL for an initially empty ViewBag. + /// The name of the template type in the cache or NULL if no caching is desired. + /// The string result of the template. + [Pure] + public virtual string Parse(string razorTemplate, object model, DynamicViewBag viewBag, string cacheName) + { + ITemplate instance; + + if (cacheName == null) + instance = CreateTemplate(razorTemplate, typeof(T), model); + else + instance = GetTemplate(razorTemplate, model, cacheName); + + return Run(instance, viewBag); + } + + /// + /// Parses the specified set of templates. + /// + /// The set of string templates to parse. + /// + /// The set of models or NULL if no models exist for all templates. + /// Individual elements in this set may be NULL if no model exists for a specific template. + /// + /// + /// The set of initial ViewBag contents or NULL for an initially empty ViewBag for all templates. + /// Individual elements in this set may be NULL if an initially empty ViewBag is desired for a specific template. + /// + /// + /// The set of cache names or NULL if no caching is desired for all templates. + /// Individual elements in this set may be NULL if caching is not desired for specific template. + /// + /// Flag to determine whether parsing in parallel. + /// The set of parsed template results. + public virtual IEnumerable ParseMany(IEnumerable razorTemplates, IEnumerable models, IEnumerable viewBags, IEnumerable cacheNames, bool parallel) + { + if (razorTemplates == null) + throw new ArgumentException("Expected at least one entry in razorTemplates collection."); + + if ((models != null) && (razorTemplates.Count() != models.Count())) + throw new ArgumentException("Expected same number of models as string templates to be processed."); + + if ((viewBags != null) && (razorTemplates.Count() != viewBags.Count())) + throw new ArgumentException("Expected same number of viewBags as string templates to be processed."); + + if ((cacheNames != null) && (razorTemplates.Count() != cacheNames.Count())) + throw new ArgumentException("Expected same number of cacheNames as string templates to be processed."); + + var modelList = (models == null) ? null : models.ToList(); + var viewBagList = (viewBags == null) ? null : viewBags.ToList(); + var cacheNameList = (cacheNames == null) ? null : cacheNames.ToList(); + + // + // :Matt: + // What is up with the GetParallelQueryPlan() here? + // o Everywhere else in the code we simply return the ParallelQueryPlan + // (this implements IEnumerablt + // o However, when I remove the ToArray() in the following code, + // the unit tests that call ParseMany() start failing, complaining + // about serialization (give it a try) + // o Should all GetParallelQueryPlan() results call ToList() + // to force Linq to execute the results? + // o If we do not call ToArray() below, then the Parse() + // method never gets called. + // o Something is wrong or inconsistent here. :) + // + if (parallel) + { + return GetParallelQueryPlan() + .CreateQuery(razorTemplates) + .Select((t, i) => Parse(t, + (modelList == null) ? null : modelList[i], + (viewBagList == null) ? null : viewBagList[i], + (cacheNameList == null) ? null : cacheNameList[i])) + .ToArray(); + } + return razorTemplates.Select((t, i) => Parse(t, + (modelList == null) ? null : modelList[i], + (viewBagList == null) ? null : viewBagList[i], + (cacheNameList == null) ? null : cacheNameList[i])) + .ToArray(); + } + + /// + /// Returns whether or not a template by the specified name has been created already. + /// + /// The name of the template type in cache. + /// Whether or not the template has been created. + public bool HasTemplate(string cacheName) + { + return _cache.ContainsKey(cacheName); + } + + /// + /// Remove a template by the specified name from the cache. + /// + /// The name of the template type in cache. + /// Whether or not the template has been removed. + public bool RemoveTemplate(string cacheName) + { + CachedTemplateItem item; + return _cache.TryRemove(cacheName, out item); + } + + + /// + /// Resolves the template with the specified name. + /// + /// The name of the template type in cache. + /// The model or NULL if there is no model for the template. + /// The resolved template. + public virtual ITemplate Resolve(string cacheName, object model) + { + CachedTemplateItem cachedItem; + ITemplate instance = null; + if (_cache.TryGetValue(cacheName, out cachedItem)) + instance = CreateTemplate(null, cachedItem.TemplateType, model); + + if (instance == null && _config.Resolver != null) + { + string template = _config.Resolver.Resolve(cacheName); + if (!string.IsNullOrWhiteSpace(template)) + instance = GetTemplate(template, model, cacheName); + } + + return instance; + } + + /// + /// Runs the template with the specified cacheName. + /// + /// The name of the template in cache. The template must be in cache. + /// The model for the template or NULL if there is no model. + /// The initial ViewBag contents NULL for an empty ViewBag. + /// The string result of the template. + public string Run(string cacheName, object model, DynamicViewBag viewBag) + { + if (string.IsNullOrWhiteSpace(cacheName)) + throw new ArgumentException("'cacheName' is a required parameter."); + + CachedTemplateItem item; + if (!(_cache.TryGetValue(cacheName, out item))) + throw new InvalidOperationException("No template exists with name '" + cacheName + "'"); + + ITemplate instance = CreateTemplate(null, item.TemplateType, model); + + return Run(instance, viewBag); + } + + /// + /// Runs the specified template and returns the result. + /// + /// The template to run. + /// The ViewBag contents or NULL for an initially empty ViewBag. + /// The string result of the template. + public string Run(ITemplate template, DynamicViewBag viewBag) + { + if (template == null) + throw new ArgumentNullException("template"); + + return template.Run(CreateExecuteContext(viewBag)); + } + + /// + /// Sets the model for the template. + /// + /// The model type. + /// The template instance. + /// The model instance. + private static void SetModel(ITemplate template, T model) + { + if (model == null) return; + + var dynamicTemplate = template as ITemplate; + if (dynamicTemplate != null) + { + dynamicTemplate.Model = model; + return; + } + + var staticModel = template as ITemplate; + if (staticModel != null) + { + staticModel.Model = model; + return; + } + + SetModelExplicit(template, model); + } + + /// + /// Sets the model for the template. + /// + /// + /// This method uses reflection to set the model property. As we can't guaruntee that we know + /// what model type they will be using, we have to do the hard graft. The preference would be + /// to use the generic method instead. + /// + /// The template instance. + /// The model instance. + private static void SetModelExplicit(ITemplate template, object model) + { + var type = template.GetType(); + var prop = type.GetProperty("Model"); + + if (prop != null) + prop.SetValue(template, model, null); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/TemplateServiceFactory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/TemplateServiceFactory.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,39 @@ +namespace RazorEngine.Templating +{ + using Configuration; + + /// + /// Provides factory methods for creating instances. + /// + public static class TemplateServiceFactory + { + #region Fields + private static readonly RazorEngineConfigurationSection Configuration; + #endregion + + #region Constructor + /// + /// Initialises the type. + /// + static TemplateServiceFactory() + { + Configuration = RazorEngineConfigurationSection.GetConfiguration(); + } + #endregion + + #region Methods + + /// + /// Creates an instance of a template service. + /// + /// The language to use in this service. + /// The type of encoding to use in this service. + /// + public static ITemplateService CreateTemplateService(Language language, Encoding encoding) + { + return null; + } + + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/TemplateWriter.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/TemplateWriter.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,54 @@ +namespace RazorEngine.Templating +{ + using System; + using System.Diagnostics.Contracts; + using System.Globalization; + using System.IO; + + /// + /// Defines a template writer used for helper templates. + /// + public class TemplateWriter + { + #region Fields + private readonly Action writerDelegate; + #endregion + + #region Constructors + /// + /// Initialises a new instance of . + /// + /// The writer delegate used to write using the specified . + public TemplateWriter(Action writer) + { + Contract.Requires(writer != null); + + writerDelegate = writer; + } + #endregion + + #region Methods + /// + /// Executes the write delegate and returns the result of this . + /// + /// The string result of the helper template. + public override string ToString() + { + using (var writer = new StringWriter(CultureInfo.InvariantCulture)) + { + writerDelegate(writer); + return writer.ToString(); + } + } + + /// + /// Writes the helper result of the specified text writer. + /// + /// The text writer to write the helper result to. + public void WriteTo(TextWriter writer) + { + writerDelegate(writer); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Templating/TypeLoader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Templating/TypeLoader.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,121 @@ +namespace RazorEngine.Templating +{ + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Diagnostics.Contracts; + using System.Linq; + using System.Linq.Expressions; + using System.Reflection; + + /// + /// Defines a type loader. + /// + public class TypeLoader : IDisposable + { + #region Fields + private readonly AppDomain _appDomain; + private readonly IEnumerable _assemblies; + private readonly ConcurrentDictionary> _constructors; + private readonly ResolveEventHandler _resolveEventHandler; + private bool disposed; + #endregion + + #region Constructor + /// + /// Initialises a new instance of + /// + /// The application domain. + /// The set of assemblies. + public TypeLoader(AppDomain appDomain, IEnumerable assemblies) + { + Contract.Requires(appDomain != null); + Contract.Requires(assemblies != null); + + _appDomain = appDomain; + _assemblies = assemblies; + _constructors = new ConcurrentDictionary>(); + _resolveEventHandler = (s, e) => ResolveAssembly(e.Name); + + _appDomain.AssemblyResolve += _resolveEventHandler; + } + #endregion + + #region Methods + /// + /// Creates an instance of the specified type. + /// + /// The type to create. + /// An instance of the type. + public ITemplate CreateInstance(Type type) + { + Contract.Requires(type != null); + + if (disposed) + throw new ObjectDisposedException("TypeLoader"); + + var ctor = GetConstructor(type); + return ctor(); + } + + /// + /// Releases resources used by this instance. + /// + /// Flag to determine whether this instance is being disposed of explicitly. + protected virtual void Dispose(bool disposing) + { + if (!disposed && disposing) + { + _appDomain.AssemblyResolve -= _resolveEventHandler; + disposed = true; + } + } + + /// + /// Releases resources used by this reference. + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + /// Gets the delegate used to create an instance of the template type. + /// This method will consider the cached constructor delegate before creating an instance of one. + /// + /// The template type. + /// The delegate instance. + private Func GetConstructor(Type type) + { + return _constructors + .GetOrAdd(type, GetConstructorInternal); + } + + /// + /// Gets the delegate used to create an instance of the template type. + /// + /// The template type. + /// The delegate instance. + private static Func GetConstructorInternal(Type type) + { + var method = type.GetConstructor(new Type[0]); + + return Expression.Lambda>( + Expression.New(method)).Compile(); + } + + /// + /// Resolves the assembly with the specified name. + /// + /// The name of the assembly. + /// The assembly instance, or null. + private Assembly ResolveAssembly(string name) + { + return _assemblies + .Where(a => a.FullName.Equals(name)) + .FirstOrDefault(); + } + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Text/HtmlEncodedString.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Text/HtmlEncodedString.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,46 @@ +namespace RazorEngine.Text +{ + using System.Net; + + /// + /// Represents a Html-encoded string. + /// + public class HtmlEncodedString : IEncodedString + { + #region Fields + private readonly string _encodedString; + #endregion + + #region Constructor + /// + /// Initialises a new instance of + /// + /// The raw string to be encoded. + public HtmlEncodedString(string value) + { + if (!string.IsNullOrWhiteSpace(value)) + _encodedString = WebUtility.HtmlEncode(value); + } + #endregion + + #region Methods + /// + /// Gets the encoded string. + /// + /// The encoded string. + public string ToEncodedString() + { + return _encodedString ?? string.Empty; + } + + /// + /// Gets the string representation of this instance. + /// + /// The string representation of this instance. + public override string ToString() + { + return ToEncodedString(); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Text/HtmlEncodedStringFactory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Text/HtmlEncodedStringFactory.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,37 @@ +namespace RazorEngine.Text +{ + /// + /// Represents a factory that creates instances. + /// + public class HtmlEncodedStringFactory : IEncodedStringFactory + { + #region Methods + /// + /// Creates a instance for the specified raw string. + /// + /// The raw string. + /// An instance of . + public IEncodedString CreateEncodedString(string rawString) + { + return new HtmlEncodedString(rawString); + } + + /// + /// Creates a instance for the specified object instance. + /// + /// The object instance. + /// An instance of . + public IEncodedString CreateEncodedString(object value) + { + if (value == null) + return new HtmlEncodedString(string.Empty); + + var htmlString = value as HtmlEncodedString; + if (htmlString != null) + return htmlString; + + return new HtmlEncodedString(value.ToString()); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Text/IEncodedString.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Text/IEncodedString.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,16 @@ +namespace RazorEngine.Text +{ + /// + /// Defines the required contract for implementing an encoded string. + /// + public interface IEncodedString + { + #region Methods + /// + /// Gets the encoded string. + /// + /// The encoded string. + string ToEncodedString(); + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Text/IEncodedStringFactory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Text/IEncodedStringFactory.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,24 @@ +namespace RazorEngine.Text +{ + /// + /// Defines the required contract for implementing a factory for building encoded strings. + /// + public interface IEncodedStringFactory + { + #region Methods + /// + /// Creates a instance for the specified raw string. + /// + /// The raw string. + /// An instance of . + IEncodedString CreateEncodedString(string value); + + /// + /// Creates a instance for the specified object instance. + /// + /// The object instance. + /// An instance of . + IEncodedString CreateEncodedString(object value); + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Text/RawString.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Text/RawString.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,43 @@ +namespace RazorEngine.Text +{ + /// + /// Represents an unencoded string. + /// + public class RawString : IEncodedString + { + #region Fields + private readonly string _value; + #endregion + + #region Constructor + /// + /// Initialises a new instance of + /// + /// The value + public RawString(string value) + { + _value = value; + } + #endregion + + #region Methods + /// + /// Gets the encoded string. + /// + /// The encoded string. + public string ToEncodedString() + { + return _value ?? string.Empty; + } + + /// + /// Gets the string representation of this instance. + /// + /// The string representation of this instance. + public override string ToString() + { + return ToEncodedString(); + } + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/Text/RawStringFactory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/Text/RawStringFactory.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,32 @@ +namespace RazorEngine.Text +{ + /// + /// Represents a factory that creates instances. + /// + public class RawStringFactory : IEncodedStringFactory + { + #region Methods + /// + /// Creates a instance for the specified raw string. + /// + /// Thevalue. + /// An instance of . + public IEncodedString CreateEncodedString(string value) + { + return new RawString(value); + } + + /// + /// Creates a instance for the specified object instance. + /// + /// The value. + /// An instance of . + public IEncodedString CreateEncodedString(object value) + { + return (value == null) + ? new RawString(string.Empty) + : new RawString(value.ToString()); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/RazorEngine.Core/packages.config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/RazorEngine.Core/packages.config Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/ActivatorTestFixture.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/ActivatorTestFixture.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,53 @@ +namespace RazorEngine.Tests +{ + using System; + using System.IO; + + using Microsoft.Practices.Unity; + using Moq; + using NUnit.Framework; + + using Compilation; + using Configuration; + using Templating; + using TestTypes; + using TestTypes.Activation; + using Text; + + /// + /// Defines a test fixture that provides tests for the type. + /// + [TestFixture] + public class ActivatorTestFixture + { + #region Tests + /// + /// Tests that a custom activator can be used. In this test case, we're using Unity + /// to handle a instantiation of a custom activator. + /// + [Test] + public void TemplateService_CanSupportCustomActivator_WithUnity() + { + var container = new UnityContainer(); + container.RegisterType(typeof(ITextFormatter), typeof(ReverseTextFormatter)); + + var config = new TemplateServiceConfiguration + { + Activator = new UnityTemplateActivator(container), + BaseTemplateType = typeof(CustomTemplateBase<>) + }; + + using (var service = new TemplateService(config)) + { + const string template = "

Hello @Format(Model.Forename)

"; + const string expected = "

Hello ttaM

"; + + var model = new Person { Forename = "Matt" }; + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/CodeInspectorTestFixture.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/CodeInspectorTestFixture.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,37 @@ +namespace RazorEngine.Tests +{ + using System; + + using NUnit.Framework; + + using Compilation.Inspectors; + using Configuration; + using Templating; + using TestTypes.Inspectors; + + /// + /// Defines a test fixture that provides tests for the type. + /// + [TestFixture] + public class CodeInspectorTestFixture + { + #region Tests + /// + /// Tests that a code inspector supports add a custom inspector. + /// + [Test] + public void CodeInspector_SupportsAddingCustomInspector() + { + var config = new TemplateServiceConfiguration(); + config.CodeInspectors.Add(new ThrowExceptionCodeInspector()); + + using (var service = new TemplateService(config)) + { + const string template = "Hello World"; + + Assert.Throws(() => service.Parse(template, null, null, null)); + } + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/ConfigurationTestFixture.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/ConfigurationTestFixture.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,192 @@ +namespace RazorEngine.Tests +{ + using System; + using System.IO; + + using Moq; + using NUnit.Framework; + + using Compilation; + using Configuration; + using Templating; + using Text; + + /// + /// Defines a test fixture that provides tests for the type. + /// + [TestFixture] + public class ConfigurationTestFixture + { + #region Tests + /// + /// Tests that the fluent configuration supports adding additional namespace imports. + /// + [Test] + public void FluentTemplateServiceConfiguration_CanAddNamespaces() + { + var config = new FluentTemplateServiceConfiguration(c => c.IncludeNamespaces("RazorEngine.Templating")); + + Assert.That(config.Namespaces.Contains("RazorEngine.Templating")); + } + + /// + /// Tests that the fluent configuration can configure a template service with additional namespaces. + /// + [Test] + public void FluentTemplateServiceConfiguration_CanConfigureTemplateService_WithAdditionalNamespaces() + { + var config = new FluentTemplateServiceConfiguration( + c => c.IncludeNamespaces("System.IO")); + + using (var service = new TemplateService(config)) + { + const string template = "@Directory.GetFiles(\"C:\\\\\", \"*.*\").Length"; + + int expected = Directory.GetFiles(@"C:\", "*.*").Length; + string result = service.Parse(template, null, null, null); + + Assert.That(expected == int.Parse(result)); + } + } + + /// + /// Tests that the fluent configuration can configure a template service with a specific code language. + /// + /// + /// For this test, we're switching to VB, and using a @Code section: + /// + /// @Code Dim name = "Matt" End Code + /// @name + /// + /// ... which should result in: + /// + /// + /// Matt + /// + /// + [Test] + public void FluentTemplateServiceConfiguration_CanConfigureTemplateService_WithSpecificCodeLanguage() + { + var config = new FluentTemplateServiceConfiguration( + c => c.WithCodeLanguage(Language.VisualBasic)); + + using (var service = new TemplateService(config)) + { + const string template = "@Code Dim name = \"Matt\" End Code\n@name"; + const string expected = "\nMatt"; + + string result = service.Parse(template, null, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that the fluent configuration can configure a template service with a specific encoding. + /// + [Test] + public void FluentTemplateServiceConfiguration_CanConfigureTemplateService_WithSpecificEncoding() + { + var config = new FluentTemplateServiceConfiguration( + c => c.WithEncoding(Encoding.Raw)); + + using (var service = new TemplateService(config)) + { + const string template = "

Hello @Model.String

"; + const string expected = "

Hello Matt & World

"; + + var model = new { String = "Matt & World" }; + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that the fluent configuration supports setting a custom activator. + /// + [Test] + public void FluentTemplateServiceConfiguration_CanSetActivator_UsingActivator() + { + var mock = new Mock(); + + var config = new FluentTemplateServiceConfiguration(c => c.ActivateUsing(mock.Object)); + + Assert.That(config.Activator == mock.Object); + } + + /// + /// Tests that the fluent configuration supports setting the code language. + /// + [Test] + public void FluentTemplateServiceConfiguration_CanSetCodeLanguage() + { + var config = new FluentTemplateServiceConfiguration(c => c.WithCodeLanguage(Language.VisualBasic)); + + Assert.That(config.Language == Language.VisualBasic); + } + + /// + /// Tests that the fluent configuration supports setting the compiler service factory. + /// + [Test] + public void FluentTemplateServiceConfiguration_CanSetCompilerServiceFactory() + { + var mock = new Mock(); + + var config = new FluentTemplateServiceConfiguration(c => c.CompileUsing(mock.Object)); + + Assert.That(config.CompilerServiceFactory == mock.Object); + } + + /// + /// Tests that the fluent configuration supports setting the encoded string factory. + /// + [Test] + public void FluentTemplateServiceConfiguration_CanSetEncodedStringFactory() + { + var mock = new Mock(); + + var config = new FluentTemplateServiceConfiguration(c => c.EncodeUsing(mock.Object)); + + Assert.That(config.EncodedStringFactory == mock.Object); + } + + /// + /// Tests that the fluent configuration supports setting the encoded string factory using a predefined encoding. + /// + [Test] + public void FluentTemplateServiceConfiguration_CanSetEncoding_UsingHtmlEncoding() + { + var config = new FluentTemplateServiceConfiguration(c => c.WithEncoding(Encoding.Html)); + + Assert.That(config.EncodedStringFactory is HtmlEncodedStringFactory); + } + + /// + /// Tests that the fluent configuration supports setting the encoded string factory using a predefined encoding. + /// + [Test] + public void FluentTemplateServiceConfiguration_CanSetEncoding_UsingRawEncoding() + { + var config = new FluentTemplateServiceConfiguration(c => c.WithEncoding(Encoding.Raw)); + + Assert.That(config.EncodedStringFactory is RawStringFactory); + } + + /// + /// Tests that the fluent configuration supports setting a custom activator delegate. + /// + [Test] + public void FluentTemplateServiceConfigutation_CanSetActivator_UsingDelegate() + { + Func activator = i => null; + + var config = new FluentTemplateServiceConfiguration(c => c.ActivateUsing(activator)); + var delegateActivator = (DelegateActivator)config.Activator; + + Assert.That(delegateActivator.Activator == activator); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/IsolatedTemplateServiceTestFixture.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/IsolatedTemplateServiceTestFixture.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,308 @@ +namespace RazorEngine.Tests +{ + using System; + using System.Collections.Generic; + using System.Dynamic; + using System.Linq; + using System.Runtime.Serialization; + + using NUnit.Framework; + + using Compilation; + using Templating; + using TestTypes; + + /// + /// Defines a test fixture that provides tests for the type. + /// + [TestFixture] + public class IsolatedTemplateServiceTestFixture + { + #region Tests + /// + /// Tests that a simple template without a model can be parsed. + /// + [Test] + public void IsolatedTemplateService_CanParseSimpleTemplate_WithNoModel() + { + using (var service = new IsolatedTemplateService()) + { + const string template = "

Hello World

"; + const string expected = template; + + string result = service.Parse(template, null, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that a simple template with a model can be parsed. + /// + [Test] + public void IsolatedTemplateService_CanParseSimpleTemplate_WithComplexSerializableModel() + { + using (var service = new IsolatedTemplateService()) + { + const string template = "

Hello @Model.Forename

"; + const string expected = "

Hello Matt

"; + + var model = new Person { Forename = "Matt" }; + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that a simple template with a non-serializable model cannot be parsed. + /// + [Test] + public void IsolatedTemplateService_CannotParseSimpleTemplate_WithComplexNonSerializableModel() + { + using (var service = new IsolatedTemplateService()) + { + const string template = "

Animal Type: @Model.Type

"; + + Assert.Throws(() => + { + var model = new Animal { Type = "Cat" }; + service.Parse(template, model, null, null); + }); + } + } + + /// + /// Tests that a simple template with an anonymous model cannot be parsed. + /// + /// + /// This may seem pointless to test, as the will explicitly + /// check and throw the exception, it's worth creating a test for future reference. It's also + /// something we can check should we ever find a way to support dynamic/anonymous objects + /// across application domain boundaries. + /// + [Test] + public void IsolatedTemplateService_CannotParseSimpleTemplate_WithAnonymousModel() + { + using (var service = new IsolatedTemplateService()) + { + const string template = "

Animal Type: @Model.Type

"; + + Assert.Throws(() => + { + var model = new { Type = "Cat" }; + service.Parse(template, model, null, null); + }); + } + } + + /// + /// Tests that a simple template with an expando model cannot be parsed. + /// + /// + /// This may seem pointless to test, as the will explicitly + /// check and throw the exception, it's worth creating a test for future reference. It's also + /// something we can check should we ever find a way to support dynamic/anonymous objects + /// across application domain boundaries. + /// + [Test] + public void IsolatedTemplateService_CannotParseSimpleTemplate_WithExpandoModel() + { + using (var service = new IsolatedTemplateService()) + { + const string template = "

Animal Type: @Model.Type

"; + + Assert.Throws(() => + { + dynamic model = new ExpandoObject(); + model.Type = "Cat"; + service.Parse(template, model, null, null); + }); + } + } + + /// + /// Tests that a simple template with a dynamic model cannot be parsed. + /// + /// + /// This may seem pointless to test, as the will explicitly + /// check and throw the exception, it's worth creating a test for future reference. It's also + /// something we can check should we ever find a way to support dynamic/anonymous objects + /// across application domain boundaries. + /// + [Test] + public void IsolatedTemplateService_CannotParseSimpleTemplate_WithDynamicModel() + { + using (var service = new IsolatedTemplateService()) + { + const string template = "

Animal Type: @Model.Type

"; + + Assert.Throws(() => + { + dynamic model = new ValueObject(new Dictionary { { "Type", "Cat" } }); + service.Parse(template, model, null, null); + }); + } + } + + /// + /// Tests that an isolated template service cannot use the same application domain as the + /// main application domain. + /// + /// + /// An isolated template service will unload it's child application domain on Dispose. We need to ensure + /// it doesn't attempt to unload the current application domain that it is running in. This may or may + /// not be the main application domain (but is very likely to be). + /// + [Test] + public void IsolatedTemplateService_WillThrowException_WhenUsingMainAppDomain() + { + Assert.Throws(() => + { + using (var service = new IsolatedTemplateService(() => AppDomain.CurrentDomain)) + { } + }); + } + + /// + /// Tests that an isolated template service cannot use a null application domain. + /// + /// + /// I had considered using the default to spawn a default + /// application domain to load templates into when a null value is returned, but behaviourly this didn't + /// seem like the right thing to do. If you're using an , + /// you should expect it to have a valid application domain, so passing null should cause an exception. + /// + [Test] + public void IsolatedTemplateService_WillThrowException_WhenUsingNullAppDomain() + { + Assert.Throws(() => + { + using (var service = new IsolatedTemplateService(() => null)) + { } + }); + } + + /// + /// Tests that a simple template with html-encoding can be parsed. + /// + /// + /// Text encoding is performed when writing objects to the template result (not literals). This test should + /// show that the template service is correctly providing the appropriate encoding factory to process + /// the object's .ToString() and automatically encode it. + /// + [Test] + public void IsolatedTemplateService_CanParseSimpleTemplate_UsingHtmlEncoding() + { + + using (var service = new IsolatedTemplateService(Encoding.Html)) + { + const string template = "

Hello @Model.Forename

"; + const string expected = "

Hello Matt & World

"; + + var model = new Person { Forename = "Matt & World" }; + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that a simple template with no-encoding can be parsed. + /// + /// + /// Text encoding is performed when writing objects to the template result (not literals). This test should + /// show that the template service is correctly providing the appropriate encoding factory to process + /// the object's .ToString() and automatically encode it. + /// + [Test] + public void IsolatedTemplateService_CanParseSimpleTemplate_UsingRawEncoding() + { + using (var service = new IsolatedTemplateService(Encoding.Raw)) + { + const string template = "

Hello @Model.Forename

"; + const string expected = "

Hello Matt & World

"; + + var model = new Person { Forename = "Matt & World" }; + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that the template service can parse multiple templates in sequence. + /// + [Test] + public void IsolatedTemplateService_CanParseMultipleTemplatesInSequence_WitNoModels() + { + using (var service = new IsolatedTemplateService()) + { + const string template = "

Hello World

"; + var templates = Enumerable.Repeat(template, 10).ToArray(); + + var results = service.ParseMany(templates, null, null, null, false); + + Assert.That(templates.SequenceEqual(results), "Rendered templates do not match expected."); + } + } + + /// + /// Tests that the template service can parse multiple templates in parallel. + /// + [Test] + public void IsolatedTemplateService_CanParseMultipleTemplatesInParallel_WitNoModels() + { + using (var service = new IsolatedTemplateService()) + { + const string template = "

Hello World

"; + var templates = Enumerable.Repeat(template, 10).ToArray(); + + var results = service.ParseMany(templates, null, null, null, true); + + Assert.That(templates.SequenceEqual(results), "Rendered templates do not match expected."); + } + } + + /// + /// Tests that the template service can parse multiple templates in sequence with complex models. + /// + [Test] + public void IsolatedTemplateService_CanParseMultipleTemplatesInSequence_WithComplexModels() + { + const int maxTemplates = 10; + + using (var service = new IsolatedTemplateService()) + { + const string template = "

Age: @Model.Age

"; + var expected = Enumerable.Range(1, maxTemplates).Select(i => string.Format("

Age: {0}

", i)); + var templates = Enumerable.Repeat(template, maxTemplates).ToArray(); + var models = Enumerable.Range(1, maxTemplates).Select(i => new Person { Age = i }).ToArray(); + + var results = service.ParseMany(templates, models, null, null, false); + Assert.That(expected.SequenceEqual(results), "Parsed templates do not match expected results."); + } + } + + /// + /// Tests that the template service can parse multiple templates in parallel with complex models. + /// + [Test] + public void IsolatedTemplateService_CanParseMultipleTemplatesInParallel_WithComplexModels() + { + const int maxTemplates = 10; + + using (var service = new IsolatedTemplateService()) + { + const string template = "

Age: @Model.Age

"; + var expected = Enumerable.Range(1, maxTemplates).Select(i => string.Format("

Age: {0}

", i)); + var templates = Enumerable.Repeat(template, maxTemplates).ToArray(); + var models = Enumerable.Range(1, maxTemplates).Select(i => new Person { Age = i }).ToArray(); + + var results = service.ParseMany(templates, models, null, null, true); + Assert.That(expected.SequenceEqual(results), "Parsed templates do not match expected results."); + } + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/Issues/Release_3_0_TestFixture.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/Issues/Release_3_0_TestFixture.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,382 @@ +namespace RazorEngine.Tests.TestTypes.Issues +{ + using System; + using System.Collections.Generic; + using Microsoft.CSharp.RuntimeBinder; + + using NUnit.Framework; + + using Configuration; + using Templating; + + /// + /// Provides tests for the Release 3.0 + /// + [TestFixture] + public class Release_3_0_TestFixture + { + #region Tests + /// + /// When using a template layout, the model needs to be passed to the layout template from the child. + /// + /// Issue 6: https://github.com/Antaris/RazorEngine/issues/6 + /// + [Test] + public void Issue6_ModelShouldBePassedToLayout() + { + using (var service = new TemplateService()) + { + const string layoutTemplate = "

@Model.PageTitle

@RenderSection(\"Child\")"; + const string childTemplate = "@{ Layout = \"Parent\"; }@section Child {

@Model.PageDescription

}"; + const string expected = "

Test Page

Test Page Description

"; + + var model = new { + PageTitle = "Test Page", + PageDescription = "Test Page Description" + }; + + var type = model.GetType(); + + service.Compile(layoutTemplate, type, "Parent"); + + string result = service.Parse(childTemplate, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// A viewbag property is an easy way to share state between layout templates and the rendering template. The ViewBag property + /// needs to persist from layouts and child templates. + /// + /// Issue 7: https://github.com/Antaris/RazorEngine/issues/7 + /// + [Test] + public void Issue7_ViewBagShouldPersistThroughLayout() + { + using (var service = new TemplateService()) + { + const string layoutTemplate = "

@ViewBag.Title

@RenderSection(\"Child\")"; + const string childTemplate = "@{ Layout = \"Parent\"; ViewBag.Title = \"Test\"; }@section Child {}"; + + service.Compile(layoutTemplate, null, "Parent"); + + string result = service.Parse(childTemplate, null, null, null); + + Assert.That(result.StartsWith("

Test

")); + } + } + + /// + /// A viewbag property should not persist through using @Include as this will create a new , which + /// initialises a new viewbag property. + /// + /// Issue 7: https://github.com/Antaris/RazorEngine/issues/7 + /// + /// + /// This test no longer pass as we have changed the ViewBag property to be a fault tollerant dynamic dictionary. + /// + [Test] + public void Issue7_ViewBagShouldNotPersistThroughInclude_UsingCSharp() + { +// using (var service = new TemplateService()) +// { +// const string parentTemplate = "@{ ViewBag.Title = \"Test\"; }@Include(\"Child\")"; +// const string childTemplate = "@ViewBag.Title"; +// +// service.Compile(childTemplate, "Child"); +// +// // The C# runtime binder will throw a RuntimeBinderException... +// Assert.Throws(() => +// { +// string result = service.Parse(parentTemplate); +// }); +// } + } + + /// + /// A viewbag property should not persist through using @Include as this will create a new , which + /// initialises a new viewbag property. + /// + /// Issue 7: https://github.com/Antaris/RazorEngine/issues/7 + /// + /// + /// This test no longer pass as we have changed the ViewBag property to be a fault tollerant dynamic dictionary. + /// + [Test] + public void Issue7_ViewBagShouldNotPersistThroughInclude_UsingVB() + { +// var config = new TemplateServiceConfiguration() { Language = Language.VisualBasic }; +// using (var service = new TemplateService(config)) +// { +// const string parentTemplate = @" +//@Code +// ViewBag.Title = ""Test"" +//End Code +//@Include(""Child"")"; +// const string childTemplate = "@ViewBag.Title"; +// +// service.Compile(childTemplate, "Child"); +// +// // The VB runtime binder will through a MissingMemberException... +// Assert.Throws(() => +// { +// string result = service.Parse(parentTemplate); +// }); +// } + } + + /// + /// The template service should have the ability to compile a template with out a model. + /// + /// Issue 11: https://github.com/Antaris/RazorEngine/issues/11 + /// + [Test] + public void Issue11_TemplateServiceShouldCompileModellessTemplate() + { + using (var service = new TemplateService()) + { + const string template = "

Hello World

"; + + service.Compile(template, null, "issue11"); + } + } + + /// + /// The last property/method result in an expression, which returns a null value + /// should not write to the template. + /// + /// Issue 16: https://github.com/Antaris/RazorEngine/issues/16 + /// + [Test] + public void Issue16_LastNullValueShouldReturnEmptyString() + { + using (var service = new TemplateService()) + { + const string template = "

Hello @Model.Person.Forename

"; + const string expected = "

Hello

"; + + var model = new { Person = new Person { Forename = null } }; + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// We should support overriding the model type for templates that do not specify @model. + /// + /// Issue 17: https://github.com/Antaris/RazorEngine/issues/17 + /// + [Test] + public void TemplateService_ShouldAllowTypeOverrideForNonGenericCompile() + { + using (var service = new TemplateService()) + { + const string template = "@Model.Name"; + const string expected = "Matt"; + + object model = new { Name = "Matt" }; + + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// We should support nullable value types in expressions. I think this will work because of the + /// change made for Issue 16. + /// + /// Issue 18: https://github.com/Antaris/RazorEngine/issues/18 + /// + [Test] + public void TemplateService_ShouldEnableNullableValueTypes() + { + using (var service = new TemplateService()) + { + const string template = "

Hello @Model.Number

"; + const string expected = "

Hello

"; + + var model = new { Number = (int?)null }; + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Subclassed models should be supported in layouts (and also partials). + /// + /// Issue 21: https://github.com/Antaris/RazorEngine/issues/21 + /// + [Test] + public void Issue21_SubclassModelShouldBeSupportedInLayout() + { + using (var service = new TemplateService()) + { + const string parent = "@model RazorEngine.Tests.TestTypes.Person\n

@Model.Forename

@RenderSection(\"Child\")"; + service.Compile(parent, null, "Parent"); + + const string child = "@{ Layout = \"Parent\"; }\n@section Child {

@Model.Department

}"; + const string expected = "

Matt

IT

"; + + var model = new Employee + { + Age = 27, + Department = "IT", + Forename = "Matt", + Surname = "Abbott" + }; + + string result = service.Parse(child, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Requested functionality to allow deep nulls on dynamic models to fail silently without throwing exceptions. + /// + /// Issue 22: https://github.com/Antaris/RazorEngine/issues/22 + /// + [Test] + public void Issue22_MissingDynamicPropertiesCausesException() + { + using (var service = new TemplateService(new TemplateServiceConfiguration() + { + AllowMissingPropertiesOnDynamic = true + })) + { + const string template = "Missing property: @Model.Something.SomethingElse"; + const string expected = "Missing property: "; + + var model = new { Name = "Matt" }; + + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// ViewBag initialization not possible outside of template. + /// + /// Issue 26: https://github.com/Antaris/RazorEngine/issues/26 + /// + [Test] + public void Issue26_ViewBagInitializationOutsideOfTemplate() + { + using (var service = new TemplateService()) + { + const string template = "@ViewBag.TestValue"; + const string expected = "This is a test"; + + DynamicViewBag viewBag = new DynamicViewBag(); + viewBag.AddValue("TestValue", "This is a test"); + + string result = service.Parse(template, null, viewBag, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// StreamLining the ITemplateServiceAPI. + /// + /// Issue 27: https://github.com/Antaris/RazorEngine/issues/27 + /// + /// + /// Streamlining the interface did not change funcionality - it just consolidated + /// overloads into a single methods to simplify Interface implementation. + ///

+ /// There is one exception - the CreateTemplates() method. + /// This was enhanced to:
+ /// 1) Allow a NULL razorTemplates parameter if templateTypes are specified.
+ /// 2) Allow a NULL templateTypes parameter if razorTemplates are specified.
+ /// 3) Allow both razorTemplates / templateTypes to be specified and have some templates and some templates dynamically compiled. + ///

+ /// This test case tests for success and exception conditions in features 1-3. + ///
+ [Test] + public void Issue27_StreamLiningTheITemplateServiceApi_CreateTemplates() + { + string[] razorTemplates; + Type[] templateTypes; + int index; + + using (var service = new TemplateService()) + { + // Success case + razorTemplates = new string[] { "Template1", "Template2", "Template3" }; + templateTypes = new Type[] { null, null, null }; + IEnumerable instances = service.CreateTemplates(razorTemplates, templateTypes, null, false); + + index = 0; + foreach (ITemplate instance in instances) + { + string expected = razorTemplates[index]; + string result = service.Run(instance, null); + Assert.That(result == expected, "Result does not match expected: " + result); + index++; + } + + // No razorTemplates or templateTypes provided + Assert.Throws(() => + { + service.CreateTemplates(null, null, null, false); + }); + + // Unbalanced razorTemplates/templateTypes (templateTypes to small) + Assert.Throws(() => + { + razorTemplates = new string[] { "Template1", "Template2", "Template3" }; + templateTypes = new Type[] { null, null }; + service.CreateTemplates(razorTemplates, templateTypes, null, false); + }); + + // Unbalanced razorTemplates/templateTypes (templateTypes too large) + Assert.Throws(() => + { + razorTemplates = new string[] { "Template1", "Template2", "Template3" }; + templateTypes = new Type[] { null, null, null, null }; + service.CreateTemplates(razorTemplates, templateTypes, null, false); + }); + + // Unbalanced razorTemplates/templateTypes (razorTemplates and templateTypes are NULL) + Assert.Throws(() => + { + razorTemplates = new string[] { "Template1", "Template2", null }; + templateTypes = new Type[] { null, null, null }; + service.CreateTemplates(razorTemplates, templateTypes, null, false); + }); + } + } + + /// + /// Dynamic ViewBag properties should be persisted to the viewbag used for include templates. + /// + /// Issue 133: https://github.com/Antaris/RazorEngine/issues/133 + /// + [Test] + public void Issue133_ViewBagShouldPersistToIncludes() + { + using (var service = new TemplateService()) + { + const string child = "

@ViewBag.Name

"; + const string template = "@Include(\"Child\")"; + const string expected = "

Matt

"; + + dynamic bag = new DynamicViewBag(); + bag.Name = "Matt"; + + + service.GetTemplate(child, null, "Child"); + string result = service.Parse(template, null, bag, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/Properties/AssemblyInfo.cs Sun Aug 24 11:14:55 2014 +0400 @@ -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("RazorEngine.Core.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("RazorEngine.Core.Tests")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[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("279faf7a-64a4-4537-b4cd-2023f6652acf")] + +// 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 -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/RazorEngine.Core.Tests.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/RazorEngine.Core.Tests.csproj Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,106 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {F4F5AB5F-BF81-4C0C-8F2E-68AB02160C4E} + Library + Properties + RazorEngine.Tests + RazorEngine.Core.Tests + v4.5 + 512 + + + + true + full + false + bin\Debug\ + TRACE;DEBUG + prompt + 4 + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + true + + + RazorEngine.snk + + + + False + ..\..\..\packages\Unity.3.0.1304.1\lib\Net45\Microsoft.Practices.Unity.dll + + + False + ..\..\..\packages\Unity.3.0.1304.1\lib\Net45\Microsoft.Practices.Unity.Configuration.dll + + + False + ..\..\..\packages\Moq.4.1.1309.1617\lib\net40\Moq.dll + + + False + ..\..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {D268F86D-2DAB-4329-A75F-3BCF6D5BCDC4} + RazorEngine.Core + + + + + + \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/RazorEngine.snk Binary file src/Core/Tests/RazorEngine.Core.Tests/RazorEngine.snk has changed diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/RazorEngineHostTestFixture.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/RazorEngineHostTestFixture.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,112 @@ +using RazorEngine.Tests.TestTypes.BaseTypes; + +namespace RazorEngine.Tests +{ + using System.Collections.Generic; + using System.Dynamic; + using System.Linq; + + using NUnit.Framework; + + using Compilation; + using Configuration; + using Templating; + using Text; + using TestTypes; + + /// + /// Defines a test fixture that provides tests for the type. + /// + [TestFixture] + public class RazorEngineHostTestFixture + { + #region Tests + /// + /// Tests that the supports the @model directive. + /// + /// + /// As with it's MVC counterpart, we've added support for the @model declaration. This is to enable scenarios + /// where the model type might be unknown, but we can pass in an instance of and allow + /// the @model directive to switch the model type. + /// + [Test] + public void RazorEngineHost_SupportsModelSpan_UsingCSharpCodeParser() + { + using (var service = new TemplateService()) + { + const string template = "@model List\n@Model.Count"; + const string expected = "1"; + + var model = new List { new Person() { Forename = "Matt", Age = 27 } }; + string result = service.Parse(template, (object)model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + [Test] + public void RazorEngineHost_SupportsModelSpan_WithBaseType_NotGeneric_UsingCSharpCodeParser() + { + var config = new TemplateServiceConfiguration(); + config.BaseTemplateType = typeof(TemplateBase); + using (var service = new TemplateService(config)) + { + const string template = "@model RazorEngine.Tests.TestTypes.Person\n@Model.Forename"; + const string expected = "Matt"; + + var model = new Person {Forename = "Matt"}; + string result = service.Parse(template, (object)model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that the supports the @ModelType directive. + /// + /// + /// As with it's MVC counterpart, we've added support for the @ModelType declaration. This is to enable scenarios + /// where the model type might be unknown, but we can pass in an instance of and allow + /// the @model directive to switch the model type. + /// + [Test] + public void RazorEngineHost_SupportsModelSpan_UsingVBCodeParser() + { + var config = new TemplateServiceConfiguration + { + Language = Language.VisualBasic + }; + + using (var service = new TemplateService(config)) + { + const string template = "@ModelType List(Of RazorEngine.Tests.TestTypes.Person)\n@Model.Count"; + const string expected = "1"; + + var model = new List { new Person() { Forename = "Matt", Age = 27 } }; + string result = service.Parse(template, (object)model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + [Test] + public void RazorEngineHost_SupportsModelSpan_WithBaseType_NotGeneric_UsingVBCodeParser() + { + var config = new TemplateServiceConfiguration(); + config.BaseTemplateType = typeof(TemplateBase); + config.Language = Language.VisualBasic; + + using (var service = new TemplateService(config)) + { + const string template = "@ModelType List(Of RazorEngine.Tests.TestTypes.Person)\n@Model.Count"; + const string expected = "1"; + + var model = new List { new Person() { Forename = "Matt", Age = 27 } }; + string result = service.Parse(template, (object)model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/TemplateBaseTestFixture.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/TemplateBaseTestFixture.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,181 @@ +namespace RazorEngine.Tests +{ + using System.Collections.Generic; + using System.Dynamic; + using System.Linq; + + using NUnit.Framework; + + using Configuration; + using Templating; + using Text; + using TestTypes; + + /// + /// Defines a test fixture that provides tests for the type. + /// + [TestFixture] + public class TemplateBaseTestFixture + { + #region Tests + /// + /// Tests that a call to will output the raw text when using html encoding. + /// + /// + /// includes a method which returns an instance of + /// which should bypass the string encoding when writing values. + /// + [Test] + public void TemplateBase_CanUseRawOutput_WithHtmlEncoding() + { + using (var service = new TemplateService()) + { + const string template = "

Hello @Raw(Model.Name)

"; + const string expected = "

Hello <

"; + + var model = new { Name = "<" }; + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that a template can support a layout. + /// + [Test] + public void TemplateBase_CanRenderWithLayout_WithSimpleLayout() + { + using (var service = new TemplateService()) + { + const string parent = @"
@RenderSection(""TestSection"")
@RenderBody()"; + const string template = @"@{Layout = ""Parent"";}@section TestSection {Hello}

Hello World

"; + const string expected = "
Hello

Hello World

"; + + /* GetTemplate is the simplest method for compiling and caching a template without using a + * resolver to locate the layout template at a later time in exection. */ + service.GetTemplate(parent, null, "Parent"); + string result = service.Parse(template, null, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that a template can support a layout. This test uses multiple layout templates in the template hierachy, + /// and the end result should put child content in both the outer layout (grandparent), and in the inner layout (parent). + /// + /// + /// Outer layout (grandparent): + /// <div>Message from Child Template (section): @RenderSection("ChildMessage")</div> + /// <div>Message from Parent Template (section): @RenderSection("ParentMessage")</div> + /// <div>Content from Parent Template (body): @RenderBody()</div> + /// + /// Inner layout (parent): + /// @{ + /// Layout = "GrandParent"; + /// } + /// @section ParentMessage { + /// <span>Hello from Parent</span> + /// } + /// <p>Child content: @RenderBody()</p> + /// + /// Template (child): + /// @{ + /// Layout = "Parent"; + /// } + /// @section ChildMessage { + /// <span>Hello from Child</span> + /// } + /// <p>This is child content</p> + /// + /// Expected result: + /// <div>Message from Child Template (section): + /// <span>Hello from Child</span> + /// </div> + /// <div>Message from Parent Template (section): + /// <span>Hello from Parent</span> + /// </div> + /// <div>Content from Parent Template (body): + /// <p>Child content: <p>This is child content</p></p> + /// </div> + /// + [Test] + public void TemplateBase_CanRenderWithLayout_WithComplexLayout() + { + using (var service = new TemplateService()) + { + const string grandparent = @"
Message from Child Template (section): @RenderSection(""ChildMessage"")
Message from Parent Template (section): @RenderSection(""ParentMessage"")
Content from Parent Template (body): @RenderBody()
"; + const string parent = @"@{Layout = ""GrandParent"";}@section ParentMessage {Hello from Parent}

Child content: @RenderBody()

"; + const string template = @"@{Layout = ""Parent"";}@section ChildMessage {Hello from Child}

This is child content

"; + const string expected = "
Message from Child Template (section): Hello from Child
Message from Parent Template (section): Hello from Parent
Content from Parent Template (body):

Child content:

This is child content

"; + + service.GetTemplate(parent, null, "Parent"); + service.GetTemplate(grandparent, null, "GrandParent"); + string result = service.Parse(template, null, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that a template service can include another template. + /// + [Test] + public void TemplateBase_CanRenderWithInclude_SimpleInclude() + { + using (var service = new TemplateService()) + { + const string child = "
Content from child
"; + const string template = "@Include(\"Child\")"; + const string expected = "
Content from child
"; + + service.GetTemplate(child, null, "Child"); + string result = service.Parse(template, null, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that a template service can include another template with current templete model if it was not specified. + /// + [Test] + public void TemplateBase_CanRenderWithInclude_WithCurrentModel() + { + using (var service = new TemplateService()) + { + const string child = "@model RazorEngine.Tests.TestTypes.Person\n
Content from child for @Model.Forename
"; + const string template = "@model RazorEngine.Tests.TestTypes.Person\n@Include(\"Child\")"; + const string expected = "
Content from child for Test
"; + var person = new Person { Forename = "Test" }; + + service.GetTemplate(child, person, "Child"); + string result = service.Parse(template, person, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that a template service can include another template with current templete model if it was not specified. + /// + [Test] + public void TemplateBase_CanRenderWithInclude_WithCustomModel() + { + using (var service = new TemplateService()) + { + const string child = "@model RazorEngine.Tests.TestTypes.Person\n
Content from child for @Model.Forename
"; + const string template = "@Include(\"Child\", new RazorEngine.Tests.TestTypes.Person { Forename = \"Test\" })"; + const string expected = "
Content from child for Test
"; + + service.GetTemplate(child, null, "Child"); + string result = service.Parse(template, null, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/TemplateServiceTestFixture.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/TemplateServiceTestFixture.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,554 @@ +using System; +using RazorEngine.Tests.TestTypes.BaseTypes; + +namespace RazorEngine.Tests +{ + using System.Collections.Generic; + using System.Dynamic; + using System.Linq; + using System.Threading; + + using NUnit.Framework; + + using Configuration; + using Templating; + using Text; + using TestTypes; + + /// + /// Defines a test fixture that provides tests for the type. + /// + [TestFixture] + public class TemplateServiceTestFixture + { + #region Tests + /// + /// Tests that a simple template without a model can be parsed. + /// + [Test] + public void TemplateService_CanParseSimpleTemplate_WithNoModel() + { + using (var service = new TemplateService()) + { + const string template = "

Hello World

"; + const string expected = template; + + string result = service.Parse(template, null, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that a simple template with a model can be parsed. + /// + [Test] + public void TemplateService_CanParseSimpleTemplate_WithComplexModel() + { + using (var service = new TemplateService()) + { + const string template = "

Hello @Model.Forename

"; + const string expected = "

Hello Matt

"; + + var model = new Person { Forename = "Matt" }; + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that a simple template with an anonymous model can be parsed. + /// + [Test] + public void TemplateService_CanParseSimpleTemplate_WithAnonymousModel() + { + using (var service = new TemplateService()) + { + const string template = "

Hello @Model.Forename

"; + const string expected = "

Hello Matt

"; + + var model = new { Forename = "Matt" }; + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that a simple template with a expando model can be parsed. + /// + [Test] + public void TemplateService_CanParseSimpleTemplate_WithExpandoModel() + { + using (var service = new TemplateService()) + { + const string template = "

Hello @Model.Forename

"; + const string expected = "

Hello Matt

"; + + dynamic model = new ExpandoObject(); + model.Forename = "Matt"; + + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that a simple template with a dynamic model can be parsed. + /// + [Test] + public void TemplateService_CanParseSimpleTemplate_WithDynamicModel() + { + using (var service = new TemplateService()) + { + const string template = "

Hello @Model.Forename

"; + const string expected = "

Hello Matt

"; + + dynamic model = new ValueObject(new Dictionary { { "Forename", "Matt" } }); + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that a simple template with an iterator model can be parsed. + /// + [Test] + public void TemplateService_CanParseSimpleTemplate_WithIteratorModel() + { + using (var service = new TemplateService()) + { + const string template = "@foreach (var i in Model) { @i }"; + const string expected = "One Two Three"; + + var model = CreateIterator("One ", "Two ", "Three"); + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + private static IEnumerable CreateIterator(params T[] items) + { + foreach (var item in items) yield return item; + } + + /// + /// Tests that a simple template with html-encoding can be parsed. + /// + /// + /// Text encoding is performed when writing objects to the template result (not literals). This test should + /// show that the template service is correctly providing the appropriate encoding factory to process + /// the object's .ToString() and automatically encode it. + /// + [Test] + public void TemplateService_CanParseSimpleTemplate_UsingHtmlEncoding() + { + + using (var service = new TemplateService()) + { + const string template = "

Hello @Model.String

"; + const string expected = "

Hello Matt & World

"; + + var model = new { String = "Matt & World" }; + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that a simple template with no-encoding can be parsed. + /// + /// + /// Text encoding is performed when writing objects to the template result (not literals). This test should + /// show that the template service is correctly providing the appropriate encoding factory to process + /// the object's .ToString() and automatically encode it. + /// + [Test] + public void TemplateService_CanParseSimpleTemplate_UsingRawEncoding() + { + var config = new TemplateServiceConfiguration() + { + EncodedStringFactory = new RawStringFactory() + }; + + using (var service = new TemplateService(config)) + { + const string template = "

Hello @Model.String

"; + const string expected = "

Hello Matt & World

"; + + var model = new { String = "Matt & World" }; + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that the template service can parse multiple templates in sequence. + /// + [Test] + public void TemplateService_CanParseMultipleTemplatesInSequence_WitNoModels() + { + using (var service = new TemplateService()) + { + const string template = "

Hello World

"; + var templates = Enumerable.Repeat(template, 10); + + var results = service.ParseMany(templates, null, null, null, false); + + Assert.That(templates.SequenceEqual(results), "Rendered templates do not match expected."); + } + } + + /// + /// Tests that the template service can parse multiple templates in parallel. + /// + [Test] + public void TemplateService_CanParseMultipleTemplatesInParallel_WitNoModels() + { + using (var service = new TemplateService()) + { + const string template = "

Hello World

"; + var templates = Enumerable.Repeat(template, 10); + + var results = service.ParseMany(templates, null, null, null, true); + + Assert.That(templates.SequenceEqual(results), "Rendered templates do not match expected."); + } + } + + /// + /// Tests that the template service can parse multiple templates in sequence with complex models. + /// + [Test] + public void TemplateService_CanParseMultipleTemplatesInSequence_WithComplexModels() + { + const int maxTemplates = 10; + + using (var service = new TemplateService()) + { + const string template = "

Age: @Model.Age

"; + var expected = Enumerable.Range(1, maxTemplates).Select(i => string.Format("

Age: {0}

", i)); + var templates = Enumerable.Repeat(template, maxTemplates); + var models = Enumerable.Range(1, maxTemplates).Select(i => new Person { Age = i }); + + var results = service.ParseMany(templates, models, null, null, false); + Assert.That(expected.SequenceEqual(results), "Parsed templates do not match expected results."); + } + } + + /// + /// Tests that the template service can parse multiple templates in parallel with complex models. + /// + [Test] + public void TemplateService_CanParseMultipleTemplatesInParallel_WithComplexModels() + { + const int maxTemplates = 10; + + using (var service = new TemplateService()) + { + const string template = "

Age: @Model.Age

"; + var expected = Enumerable.Range(1, maxTemplates).Select(i => string.Format("

Age: {0}

", i)); + var templates = Enumerable.Repeat(template, maxTemplates); + var models = Enumerable.Range(1, maxTemplates).Select(i => new Person { Age = i }); + + var results = service.ParseMany(templates, models, null, null, true); + Assert.That(expected.SequenceEqual(results), "Parsed templates do not match expected results."); + } + } + + /// + /// Tests that the template service can parse templates when using a manual threading model (i.e. manually creating + /// instances and maintaining their lifetime. + /// + [Test] + public void TemplateService_CanParseTemplatesInParallel_WithManualThreadModel() + { + var service = new TemplateService(); + + const int threadCount = 10; + const string template = "

Hello you are @Model.Age

"; + + var threads = new List(); + for (int i = 0; i < threadCount; i++) + { + // Capture enumerating index here to avoid closure issues. + int index = i; + + var thread = new Thread(() => + { + var model = new Person { Age = index }; + string expected = "

Hello you are " + index + "

"; + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + }); + + threads.Add(thread); + thread.Start(); + } + + // Block until all threads have joined. + threads.ForEach(t => t.Join()); + + service.Dispose(); + } + + /// + /// Tests that the template service can parse templates when using the threadpool. + /// + [Test] + public void TemplateService_CanParseTemplatesInParallel_WithThreadPool() + { + var service = new TemplateService(); + + const int count = 10; + const string template = "

Hello you are @Model.Age

"; + + /* As we are leaving the threading to the pool, we need a way of coordinating the execution + * of the test after the threadpool has done its work. ManualResetEvent instances are the way. */ + var resetEvents = new ManualResetEvent[count]; + for (int i = 0; i < count; i++) + { + // Capture enumerating index here to avoid closure issues. + int index = i; + + string expected = "

Hello you are " + index + "

"; + resetEvents[index] = new ManualResetEvent(false); + + var model = new Person { Age = index }; + var item = new ThreadPoolItem(model, resetEvents[index], m => + { + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + }); + + ThreadPool.QueueUserWorkItem(item.ThreadPoolCallback); + } + + // Block until all events have been set. + WaitHandle.WaitAll(resetEvents); + + service.Dispose(); + } + + /// + /// Tests that a template service can precompile a template for later execution. + /// + [Test] + public void TemplateService_CanPrecompileTemplate_WithNoModel() + { + using (var service = new TemplateService()) + { + const string template = "Hello World"; + const string expected = "Hello World"; + + service.Compile(template, null, "test"); + + string result = service.Run("test", null, null); + + Assert.That(result == expected, "Result does not match expected."); + } + } + + /// + /// Tests that a template service can precompile a template with a non generic base for later execution. + /// + [Test] + public void TemplateService_CanPrecompileTemplate_WithNoModelAndANonGenericBase() + { + var config = new TemplateServiceConfiguration {BaseTemplateType = typeof (NonGenericTemplateBase)}; + using (var service = new TemplateService(config)) + { + const string template = "

@GetHelloWorldText()

"; + const string expected = "

Hello World

"; + + service.Compile(template, null, "test"); + + string result = service.Run("test", null, null); + Assert.That(result == expected, "Result does not match expected."); + } + } + + /// + /// Tests that a template service can precompile a template for later execution. + /// + [Test] + public void TemplateService_CanPrecompileTemplate_WithSimpleModel() + { + using (var service = new TemplateService()) + { + const string template = "Hello @Model.Forename"; + const string expected = "Hello Matt"; + + var model = new Person { Forename = "Matt" }; + + service.Compile(template, typeof(Person), "test"); + + string result = service.Run("test", model, null); + + Assert.That(result == expected, "Result does not match expected."); + } + } + + /// + /// Tests that a simple helper template with html-encoding can be parsed. + /// + [Test] + public void TemplateService_CanParseSimpleHelperTemplate_UsingHtmlEncoding() + { + using (var service = new TemplateService()) + { + const string template = "

Hello @NameHelper()

@helper NameHelper() { @Model.String }"; + const string expected = "

Hello Matt & World

"; + + var model = new { String = "Matt & World" }; + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that a simple helper template with no-encoding can be parsed. + /// + [Test] + public void TemplateService_CanParseSimpleHelperTemplate_UsingRawEncoding() + { + var config = new TemplateServiceConfiguration() + { + EncodedStringFactory = new RawStringFactory() + }; + + using (var service = new TemplateService(config)) + { + const string template = "

Hello @NameHelper()

@helper NameHelper() { @Model.String }"; + const string expected = "

Hello Matt & World

"; + + var model = new { String = "Matt & World" }; + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + [Test] + public void TemplateService_CanParseSimpleTemplate_WithCorrectBaseTypeFromModel() + { + using (var service = new TemplateService()) + { + const string template = "

Hello @Model.Forename

"; + + var model = new Person { Forename = "Matt" }; + var templateInstance = service.CreateTemplate(template, null, model); + + Assert.NotNull(templateInstance as ITemplate, "Template is not derived from the correct base type"); + } + } + + [Test] + public void TemplateService_CanParseSimpleTemplate_WithNonGenericBaseType() + { + var config = new TemplateServiceConfiguration { BaseTemplateType = typeof(NonGenericTemplateBase) }; + using (var service = new TemplateService(config)) + { + const string template = "

@GetHelloWorldText()

"; + + var templateInstance = service.CreateTemplate(template, null, null); + + Assert.NotNull(templateInstance as NonGenericTemplateBase, "Template is not derived from the correct base type"); + } + } + + [Test] + public void TemplateService_CanParseSimpleTemplate_UsingLinqExtensionMethodOnArrayTypeModel() + { + using (var service = new TemplateService()) + { + const string template = "

There are @Model.Take(2).ToList().Count() animals

"; + const string expected = "

There are 2 animals

"; + + var model = new[] {new Animal {Type = "Cat"}, new Animal {Type = "Dog"}}; + + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + [Test] + public void TemplateService_CanParseSimpleTemplate_UsingLinqExtensionMethodOnArrayTypeFromModel() + { + using (var service = new TemplateService()) + { + const string template = "

There are @Model.Animals.Take(2).ToList().Count() animals

"; + const string expected = "

There are 2 animals

"; + + var model = new AnimalViewModel + { + Animals = new[] {new Animal {Type = "Cat"}, new Animal {Type = "Dog"}} + }; + + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that a tilde is expanded with html-encoding. + /// + [Test] + public void TemplateService_CanParseTildeInTemplate_UsingHtmlEncoding() { + using (var service = new TemplateService()) { + const string template = "@Model.String"; + const string expected = "Matt"; + + var model = new { String = "Matt" }; + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// Tests that a tilde is expanded with no-encoding. + /// + [Test] + public void TemplateService_CanParseTildeInTemplate_UsingRawEncoding() { + var config = new TemplateServiceConfiguration() { + EncodedStringFactory = new RawStringFactory() + }; + + using (var service = new TemplateService(config)) { + const string template = "@Model.String"; + const string expected = "Matt"; + + var model = new { String = "Matt" }; + string result = service.Parse(template, model, null, null); + + Assert.That(result == expected, "Result does not match expected: " + result); + } + } + + /// + /// When template uses layout but that layout is not specified in cache or by resolver, fail with a meaningful exception + /// + [Test] + public void TemplateBase_ParseWithLayout_WithoutPrecompiling() + { + using (var service = new TemplateService()) + { + var template = @"@{Layout = ""Layout"";} @section Body {Test}"; + Assert.Throws(() => service.Parse(template, null, null, null)); + } + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/TestTypes/Activation/CustomTemplateBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/TestTypes/Activation/CustomTemplateBase.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,43 @@ +namespace RazorEngine.Tests.TestTypes.Activation +{ + using System; + + using Templating; + + /// + /// Defines a test template base. + /// + /// The model type. + public class CustomTemplateBase : TemplateBase + { + #region Fields + private readonly ITextFormatter _formatter; + #endregion + + #region Methods + /// + /// Initialises a new instance of + /// + /// The formatter. + public CustomTemplateBase(ITextFormatter formatter) + { + if (formatter == null) + throw new ArgumentNullException("formatter"); + + _formatter = formatter; + } + #endregion + + #region Methods + /// + /// Formats the specified object. + /// + /// The value to format. + /// The string formatted value. + public string Format(object value) + { + return _formatter.Format(value.ToString()); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/TestTypes/Activation/ITextFormatter.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/TestTypes/Activation/ITextFormatter.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,17 @@ +namespace RazorEngine.Tests.TestTypes.Activation +{ + /// + /// Defines the required contract for implementing a text formatter. + /// + public interface ITextFormatter + { + #region Methods + /// + /// Formats the specified value. + /// + /// The value to format. + /// The formatted value. + string Format(string value); + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/TestTypes/Activation/ReverseTextFormatter.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/TestTypes/Activation/ReverseTextFormatter.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,24 @@ +namespace RazorEngine.Tests.TestTypes.Activation +{ + using System; + + /// + /// Reverses the contents of the specified string, + /// + public class ReverseTextFormatter : ITextFormatter + { + #region Methods + /// + /// Formats the specified value. + /// + /// The value to format. + /// The formatted value. + public string Format(string value) + { + char[] content = value.ToCharArray(); + Array.Reverse(content); + return new string(content); + } + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/TestTypes/Activation/UnityTemplateActivator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/TestTypes/Activation/UnityTemplateActivator.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,44 @@ +namespace RazorEngine.Tests.TestTypes.Activation +{ + using System; + + using Microsoft.Practices.Unity; + + using Templating; + + /// + /// Defines an activator that supports Unity. + /// + public class UnityTemplateActivator : IActivator + { + #region Fields + private readonly UnityContainer _container; + #endregion + + #region Constructor + /// + /// Initialises a new instance of . + /// + /// The unity container. + public UnityTemplateActivator(UnityContainer container) + { + if (container == null) + throw new ArgumentNullException("container"); + + _container = container; + } + #endregion + + #region Methods + /// + /// Creates an instance of the specifed template. + /// + /// The instance context. + /// An instance of . + public ITemplate CreateInstance(InstanceContext context) + { + return (ITemplate)_container.Resolve(context.TemplateType); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/TestTypes/Animal.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/TestTypes/Animal.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,15 @@ +namespace RazorEngine.Tests.TestTypes +{ + /// + /// Defines an animal. + /// + public class Animal + { + #region Properties + /// + /// Gets the animal type. + /// + public string Type { get; set; } + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/TestTypes/AnimalViewModel.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/TestTypes/AnimalViewModel.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,10 @@ +namespace RazorEngine.Tests.TestTypes +{ + /// + /// Defines a complex view model. + /// + public class AnimalViewModel + { + public Animal[] Animals { get; set; } + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/TestTypes/BaseTypes/NonGenericTemplateBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/TestTypes/BaseTypes/NonGenericTemplateBase.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,12 @@ +using RazorEngine.Templating; + +namespace RazorEngine.Tests.TestTypes.BaseTypes +{ + public abstract class NonGenericTemplateBase : TemplateBase + { + public string GetHelloWorldText() + { + return "Hello World"; + } + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/TestTypes/Employee.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/TestTypes/Employee.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,15 @@ +namespace RazorEngine.Tests.TestTypes +{ + /// + /// Defines an employee. + /// + public class Employee : Person + { + #region Properties + /// + /// Gets or sets the department. + /// + public string Department { get; set; } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/TestTypes/Inspectors/ThrowExceptionCodeInspector.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/TestTypes/Inspectors/ThrowExceptionCodeInspector.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,30 @@ +namespace RazorEngine.Tests.TestTypes.Inspectors +{ + using System.CodeDom; + + using Compilation.Inspectors; + + /// + /// Defines a code inspector that will insert a throw statement into the generated code. + /// + public class ThrowExceptionCodeInspector : ICodeInspector + { + #region Methods + /// + /// Inspects the specified code unit. + /// + /// The code unit. + /// The code namespace declaration. + /// The code type declaration. + /// The code method declaration for the Execute method. + public void Inspect(CodeCompileUnit unit, CodeNamespace ns, CodeTypeDeclaration type, CodeMemberMethod executeMethod) + { + var statement = new CodeThrowExceptionStatement( + new CodeObjectCreateExpression( + new CodeTypeReference(typeof(System.InvalidOperationException)), new CodeExpression[] {})); + + executeMethod.Statements.Insert(0, statement); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/TestTypes/Person.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/TestTypes/Person.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,28 @@ +namespace RazorEngine.Tests.TestTypes +{ + using System; + + /// + /// Defines a person. + /// + [Serializable] + public class Person + { + #region Properties + /// + /// Gets or sets the age. + /// + public int Age { get; set; } + + /// + /// Gets or sets the forename. + /// + public string Forename { get; set; } + + /// + /// Gets or sets the surname. + /// + public string Surname { get; set; } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/TestTypes/ThreadPoolItem.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/TestTypes/ThreadPoolItem.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,55 @@ +namespace RazorEngine.Tests.TestTypes +{ + using System; + using System.Threading; + + /// + /// Defines a thread pool item. + /// + /// The model type. + public class ThreadPoolItem + { + #region Fields + private readonly Action _action; + #endregion + + #region Constructor + /// + /// Initialises a new instance of . + /// + /// The model instance. + /// The reset event. + /// The action to run. + public ThreadPoolItem(T model, ManualResetEvent resetEvent, Action action) + { + Model = model; + ResetEvent = resetEvent; + _action = action; + } + #endregion + + #region Methods + /// + /// The callback method invoked by the threadpool. + /// + /// Any current state. + public void ThreadPoolCallback(object state) + { + _action(Model); + ResetEvent.Set(); + } + #endregion + + #region Properties + /// + /// Gets the model. + /// + public T Model { get; private set; } + + /// + /// Gets the reset event. + /// + public ManualResetEvent ResetEvent { get; private set; } + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/TestTypes/ValueObject.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/TestTypes/ValueObject.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,33 @@ +namespace RazorEngine.Tests.TestTypes +{ + using System.Collections.Generic; + using System.Dynamic; + + public class ValueObject : DynamicObject + { + #region Fields + private readonly IDictionary _values; + #endregion + + #region Constructor + public ValueObject(IDictionary values) + { + _values = values; + } + #endregion + + #region Methods + public override bool TryGetMember(GetMemberBinder binder, out object result) + { + if (_values.ContainsKey(binder.Name)) + { + result = _values[binder.Name]; + return true; + } + + result = null; + return false; + } + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Core/Tests/RazorEngine.Core.Tests/packages.config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Core/Tests/RazorEngine.Core.Tests/packages.config Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Hosts/RazorEngine.Hosts.Console/App.config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Hosts/RazorEngine.Hosts.Console/App.config Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Hosts/RazorEngine.Hosts.Console/Program.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Hosts/RazorEngine.Hosts.Console/Program.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,59 @@ +namespace RazorEngine.Hosts.Console +{ + using System; + using System.Linq; + + using Compilation; + using Templating; + + class Program + { + static void Main(string[] args) + { + CompilerServiceBuilder.SetCompilerServiceFactory(new DefaultCompilerServiceFactory()); + + using (var service = new TemplateService()) + { + const string template = "

Age: @Model.Age

"; + var expected = Enumerable.Range(1, 10).Select(i => string.Format("

Age: {0}

", i)).ToList(); + var templates = Enumerable.Repeat(template, 10).ToList(); + var models = Enumerable.Range(1, 10).Select(i => new Person { Age = i }); + + var results = service.ParseMany(templates, models, null, null, true).ToList(); + + for (int i = 0; i < 10; i++) + { + Console.WriteLine(templates[i]); + Console.WriteLine(expected[i]); + Console.WriteLine(results[i]); + } + } + + Console.ReadKey(); + } + } + + /// + /// Defines a person. + /// + [Serializable] + public class Person + { + #region Properties + /// + /// Gets or sets the age. + /// + public int Age { get; set; } + + /// + /// Gets or sets the forename. + /// + public string Forename { get; set; } + + /// + /// Gets or sets the surname. + /// + public string Surname { get; set; } + #endregion + } +} diff -r 000000000000 -r 5bca2d201ad8 src/Hosts/RazorEngine.Hosts.Console/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Hosts/RazorEngine.Hosts.Console/Properties/AssemblyInfo.cs Sun Aug 24 11:14:55 2014 +0400 @@ -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("RazorEngine.Hosts.Console")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("RazorEngine.Hosts.Console")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("037a08ca-030c-45f5-88a1-985c07a2468a")] + +// 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 -r 000000000000 -r 5bca2d201ad8 src/Hosts/RazorEngine.Hosts.Console/RazorEngine.Hosts.Console.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Hosts/RazorEngine.Hosts.Console/RazorEngine.Hosts.Console.csproj Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,64 @@ + + + + + Debug + AnyCPU + {BC7891A1-8459-4A69-A37C-F40824E28C70} + Exe + Properties + RazorEngine.Hosts.Console + RazorEngine.Hosts.Console + v4.5 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + {d268f86d-2dab-4329-a75f-3bcf6d5bcdc4} + RazorEngine.Core + + + + + \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/RazorEngine.sln --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/RazorEngine.sln Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,93 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{CB08CC9C-1232-4F96-8A43-BFFA906D3DC8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RazorEngine.Core", "Core\RazorEngine.Core\RazorEngine.Core.csproj", "{D268F86D-2DAB-4329-A75F-3BCF6D5BCDC4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{3BBC422C-2720-487E-B46E-BFED47165373}" + ProjectSection(SolutionItems) = preProject + Shared\RazorEngine.Public.snk = Shared\RazorEngine.Public.snk + Shared\RazorEngine.snk = Shared\RazorEngine.snk + Shared\SharedAssemblyInfo.cs = Shared\SharedAssemblyInfo.cs + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{736162F9-990C-4DDA-BDC6-7FBDEC0AA857}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RazorEngine.Core.Tests", "Core\Tests\RazorEngine.Core.Tests\RazorEngine.Core.Tests.csproj", "{F4F5AB5F-BF81-4C0C-8F2E-68AB02160C4E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Hosts", "Hosts", "{31645D9C-55C6-43F4-A3EB-380DD82B338E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Web", "Web", "{8DA86295-C17B-4D67-8F94-E2463AD45459}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RazorEngine.Mvc", "Web\RazorEngine.Mvc\RazorEngine.Mvc.csproj", "{878A8554-ACF1-4A0B-9BFC-6BD5FC5048C4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RazorEngine.Hosts.Console", "Hosts\RazorEngine.Hosts.Console\RazorEngine.Hosts.Console.csproj", "{BC7891A1-8459-4A69-A37C-F40824E28C70}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D268F86D-2DAB-4329-A75F-3BCF6D5BCDC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D268F86D-2DAB-4329-A75F-3BCF6D5BCDC4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D268F86D-2DAB-4329-A75F-3BCF6D5BCDC4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {D268F86D-2DAB-4329-A75F-3BCF6D5BCDC4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {D268F86D-2DAB-4329-A75F-3BCF6D5BCDC4}.Debug|x86.ActiveCfg = Debug|Any CPU + {D268F86D-2DAB-4329-A75F-3BCF6D5BCDC4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D268F86D-2DAB-4329-A75F-3BCF6D5BCDC4}.Release|Any CPU.Build.0 = Release|Any CPU + {D268F86D-2DAB-4329-A75F-3BCF6D5BCDC4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {D268F86D-2DAB-4329-A75F-3BCF6D5BCDC4}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {D268F86D-2DAB-4329-A75F-3BCF6D5BCDC4}.Release|x86.ActiveCfg = Release|Any CPU + {F4F5AB5F-BF81-4C0C-8F2E-68AB02160C4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F4F5AB5F-BF81-4C0C-8F2E-68AB02160C4E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F4F5AB5F-BF81-4C0C-8F2E-68AB02160C4E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F4F5AB5F-BF81-4C0C-8F2E-68AB02160C4E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F4F5AB5F-BF81-4C0C-8F2E-68AB02160C4E}.Debug|x86.ActiveCfg = Debug|Any CPU + {F4F5AB5F-BF81-4C0C-8F2E-68AB02160C4E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F4F5AB5F-BF81-4C0C-8F2E-68AB02160C4E}.Release|Any CPU.Build.0 = Release|Any CPU + {F4F5AB5F-BF81-4C0C-8F2E-68AB02160C4E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F4F5AB5F-BF81-4C0C-8F2E-68AB02160C4E}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F4F5AB5F-BF81-4C0C-8F2E-68AB02160C4E}.Release|x86.ActiveCfg = Release|Any CPU + {878A8554-ACF1-4A0B-9BFC-6BD5FC5048C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {878A8554-ACF1-4A0B-9BFC-6BD5FC5048C4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {878A8554-ACF1-4A0B-9BFC-6BD5FC5048C4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {878A8554-ACF1-4A0B-9BFC-6BD5FC5048C4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {878A8554-ACF1-4A0B-9BFC-6BD5FC5048C4}.Debug|x86.ActiveCfg = Debug|Any CPU + {878A8554-ACF1-4A0B-9BFC-6BD5FC5048C4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {878A8554-ACF1-4A0B-9BFC-6BD5FC5048C4}.Release|Any CPU.Build.0 = Release|Any CPU + {878A8554-ACF1-4A0B-9BFC-6BD5FC5048C4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {878A8554-ACF1-4A0B-9BFC-6BD5FC5048C4}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {878A8554-ACF1-4A0B-9BFC-6BD5FC5048C4}.Release|x86.ActiveCfg = Release|Any CPU + {BC7891A1-8459-4A69-A37C-F40824E28C70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BC7891A1-8459-4A69-A37C-F40824E28C70}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BC7891A1-8459-4A69-A37C-F40824E28C70}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {BC7891A1-8459-4A69-A37C-F40824E28C70}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {BC7891A1-8459-4A69-A37C-F40824E28C70}.Debug|x86.ActiveCfg = Debug|Any CPU + {BC7891A1-8459-4A69-A37C-F40824E28C70}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BC7891A1-8459-4A69-A37C-F40824E28C70}.Release|Any CPU.Build.0 = Release|Any CPU + {BC7891A1-8459-4A69-A37C-F40824E28C70}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {BC7891A1-8459-4A69-A37C-F40824E28C70}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {BC7891A1-8459-4A69-A37C-F40824E28C70}.Release|x86.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {D268F86D-2DAB-4329-A75F-3BCF6D5BCDC4} = {CB08CC9C-1232-4F96-8A43-BFFA906D3DC8} + {736162F9-990C-4DDA-BDC6-7FBDEC0AA857} = {CB08CC9C-1232-4F96-8A43-BFFA906D3DC8} + {F4F5AB5F-BF81-4C0C-8F2E-68AB02160C4E} = {736162F9-990C-4DDA-BDC6-7FBDEC0AA857} + {BC7891A1-8459-4A69-A37C-F40824E28C70} = {31645D9C-55C6-43F4-A3EB-380DD82B338E} + {878A8554-ACF1-4A0B-9BFC-6BD5FC5048C4} = {8DA86295-C17B-4D67-8F94-E2463AD45459} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.0\lib\NET35 + EndGlobalSection +EndGlobal diff -r 000000000000 -r 5bca2d201ad8 src/Shared/RazorEngine.Public.snk Binary file src/Shared/RazorEngine.Public.snk has changed diff -r 000000000000 -r 5bca2d201ad8 src/Shared/RazorEngine.snk Binary file src/Shared/RazorEngine.snk has changed diff -r 000000000000 -r 5bca2d201ad8 src/Shared/SharedAssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Shared/SharedAssemblyInfo.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,17 @@ +using System; +using System.Reflection; + +#if DEBUG +[assembly: AssemblyConfiguration("Debug")] +#else +[assembly: AssemblyConfiguration("Release")] +#endif +[assembly: AssemblyCompany("RazorEngine Project")] + +[assembly: AssemblyProduct("RazorEngine")] +[assembly: AssemblyCopyright("Copyright © RazorEngine Project 2011-2013")] + +[assembly: AssemblyVersion("3.5.0.0")] +[assembly: AssemblyFileVersion("3.5.0.0")] + +//[assembly: CLSCompliant(true)] \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Web/RazorEngine.Mvc/MvcTemplateBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Web/RazorEngine.Mvc/MvcTemplateBase.cs Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,36 @@ +namespace RazorEngine.Mvc +{ + using System; + using System.Web; + using System.Web.Mvc; + + using Templating; + + /// + /// Provides a base implementation of an MVC-compatible template. + /// + public abstract class MvcTemplateBase : TemplateBase + { + #region Properties + /// + /// Gets the for this template. + /// + public HtmlHelper Html { get; private set; } + + /// + /// Gets the for this template. + /// + public UrlHelper Url { get; private set; } + #endregion + + #region Methods + public void InitHelpers() + { + var httpContext = new HttpContextWrapper(HttpContext.Current); + var handler = httpContext.CurrentHandler as MvcHandler; + if (handler == null) + throw new InvalidOperationException("Unable to run template outside of ASP.NET MVC"); + } + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/Web/RazorEngine.Mvc/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Web/RazorEngine.Mvc/Properties/AssemblyInfo.cs Sun Aug 24 11:14:55 2014 +0400 @@ -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("RazorEngine.Mvc")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("RazorEngine.Mvc")] +[assembly: AssemblyCopyright("Copyright © 2011")] +[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("e6e3699c-9a7a-4ac8-9b48-fa8292240f0b")] + +// 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 -r 000000000000 -r 5bca2d201ad8 src/Web/RazorEngine.Mvc/RazorEngine.Mvc.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Web/RazorEngine.Mvc/RazorEngine.Mvc.csproj Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,61 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {878A8554-ACF1-4A0B-9BFC-6BD5FC5048C4} + Library + Properties + RazorEngine.Mvc + RazorEngine.Mvc + v4.5 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + + + + + + + + + + + + + {D268F86D-2DAB-4329-A75F-3BCF6D5BCDC4} + RazorEngine.Core + + + + + \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/packages/Microsoft.AspNet.Razor.3.0.0/Microsoft.AspNet.Razor.3.0.0.nupkg Binary file src/packages/Microsoft.AspNet.Razor.3.0.0/Microsoft.AspNet.Razor.3.0.0.nupkg has changed diff -r 000000000000 -r 5bca2d201ad8 src/packages/Microsoft.AspNet.Razor.3.0.0/Microsoft.AspNet.Razor.3.0.0.nuspec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/packages/Microsoft.AspNet.Razor.3.0.0/Microsoft.AspNet.Razor.3.0.0.nuspec Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,19 @@ + + + + Microsoft.AspNet.Razor + 3.0.0 + Microsoft ASP.NET Razor + Microsoft + Microsoft + http://www.microsoft.com/web/webpi/eula/aspnetcomponent_rtw_ENU.htm + http://www.asp.net/web-pages + true + This package contains the runtime assemblies for ASP.NET Web Pages. ASP.NET Web Pages and the new Razor syntax provide a fast, terse, clean and lightweight way to combine server code with HTML to create dynamic web content. + This package contains the runtime assemblies for ASP.NET Web Pages. + + © Microsoft Corporation. All rights reserved. + en-US + Microsoft AspNet WebPages AspNetWebPages Razor + + \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/packages/Microsoft.AspNet.Razor.3.0.0/lib/net45/System.Web.Razor.dll Binary file src/packages/Microsoft.AspNet.Razor.3.0.0/lib/net45/System.Web.Razor.dll has changed diff -r 000000000000 -r 5bca2d201ad8 src/packages/Microsoft.AspNet.Razor.3.0.0/lib/net45/System.Web.Razor.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/packages/Microsoft.AspNet.Razor.3.0.0/lib/net45/System.Web.Razor.xml Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,5738 @@ + + + + System.Web.Razor + + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a Razor code language that is based on C# syntax. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the type of the code provider. + The type of the code provider. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new Razor code generator based on C# code language. + The newly created Razor code generator based on C# code language. + The class name for the generated code. + The name of the root namespace for the generated code. + The name of the source code file. + The Razor engine host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new code parser for C# code language. + The newly created code parser for C# code language. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the name of the C# code language. + The name of the C# code language. Value is ‘csharp’. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents results from code generation. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + true if the code generation is a success; otherwise, false. + The document. + The parser errors. + The generated code. + The dictionary of design-time generated code mappings. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The document. + The parser errors. + The generated code. + The dictionary of design-time generated code mappings. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The parser results. + The generated code. + The dictionary of design-time generated code mappings. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the dictionary of design-time generated code mappings. + The dictionary of design-time generated code mappings. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the generated code. + The generated code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the results of parsing a Razor document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + true if parsing was successful; otherwise, false. + The root node in the document’s syntax tree. + The list of errors which occurred during parsing. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The root node in the document’s syntax tree. + The list of errors which occurred during parsing. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the root node in the document’s syntax tree. + The root node in the document’s syntax tree. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the list of errors which occurred during parsing. + The list of errors which occurred during parsing. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether parsing was successful. + true if parsing was successful; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + Represents the base for all Razor code language.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + Initializes a new instance of the class.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + Gets the type of the CodeDOM provider.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The type of the CodeDOM provider. + + + Creates the code generator for the Razor code language.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The code generator for the Razor code language. + The class name. + The name of the root namespace. + The source file name. + The Razor engine host. + + + Creates the code parser for the Razor code language.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The code parser for the Razor code language. + + + Gets the language of the Razor code using the specified file extension.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The language of the Razor code. + The file extension. + + + Gets the language name of the current Razor code, that is “csharp” or “vb”.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The language name of the current Razor code. + + + Gets the list of language supported by the Razor code.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The list of language supported by the Razor code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents an attribute for the Razor directive. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The name of the attribute. + The value of the attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether this instance is equal to a specified object. + true if the object is equal to the this instance; otherwise, false. + The object to compare with this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the name of the attribute. + The name of the attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the unique type ID of the attribute. + The unique type ID of the attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the value of the attribute. + The value of the attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parser used by editors to avoid reparsing the entire document on each text change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Constructs the editor parser. + The which defines the environment in which the generated code will live. + The physical path to use in line pragmas. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines if a change will cause a structural change to the document and if not, applies it to the existing tree. If a structural change would occur, automatically starts a reparse. + A value indicating the result of the incremental parse. + The change to apply to the parse tree. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current parse tree. + The current parse tree. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases all resources used by the current instance of the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases the unmanaged resources used by the class and optionally releases the managed resources. + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Event fired when a full reparse of the document completes. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the filename of the document to parse. + The filename of the document to parse. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the auto complete string. + The auto complete string. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the host for the parse. + The host for the parse. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the last result of the parse was provisionally accepted for next partial parse. + true if the last result of the parse was provisionally accepted for next partial parse; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the generated code for the razor engine host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The specified code language. + + + Initializes a new instance of the class. + The specified code language. + The markup parser factory. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the languages supported by the code generator. + The languages supported that by the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a markup parser using the specified language parser for the . + A markup parser to create using the specified language parser for the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the methods as language-specific Razor code generator. + The methods as language-specific Razor code generator. + The C# or Visual Basic code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the methods as language-specific Razor code parser using the specified language parser. + The methods as language-specific Razor code parser using the specified language parser. + The C# or Visual Basic code parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the method to decorate markup parser using the specified language parser. + The method to decorate markup parser using the specified language parser. + The C# or Visual Basic code parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the default base class for the host. + The default base class for the host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the default class name for the host. + The default class name for the host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the default namespace for the host. + The default namespace for the host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the mode designs a time for the host. + true if the mode designs a time for the host; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the host that enables the instrumentation. + The host that enables the instrumentation. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the generated class context for the host. + The generated class context for the host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the instrumented source file path for the host. + The instrumented source file path for the host. + + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the namespace imports for the host. + The namespace imports for the host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns this method to post all the processed generated code for the host. + The code compile unit. + The generated namespace. + The generated class. + The execute method. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns this method to post all the processed generated code for the host. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the static helpers for the host. + The static helpers for the host. + + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents an entry-point to the Razor Template Engine. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a code generator. + The created . + The name of the generated class. + The namespace in which the generated class will reside. + The file name to use in line pragmas. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a . + The created . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the default class name of the template. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the default namespace for the template. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. + The resulting parse tree AND generated Code DOM tree. + The input text to parse. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. + The resulting parse tree AND generated Code DOM tree. + The input text to parse. + A token used to cancel the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. + The resulting parse tree AND generated Code DOM tree. + The input text to parse. + The name of the generated class, overriding whatever is specified in the host. + The namespace in which the generated class will reside. + The file name to use in line pragmas. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. + The resulting parse tree AND generated Code DOM tree. + The input text to parse. + The name of the generated class, overriding whatever is specified in the host. + The namespace in which the generated class will reside. + The file name to use in line pragmas. + A token used to cancel the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. + The resulting parse tree AND generated Code DOM tree. + The input text to parse. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. + The resulting parse tree AND generated Code DOM tree. + The input text to parse. + A token used to cancel the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. + The resulting parse tree AND generated Code DOM tree. + The input text to parse. + The name of the generated class, overriding whatever is specified in the host. + The namespace in which the generated class will reside. + The file name to use in line pragmas. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. + The resulting parse tree AND generated Code DOM tree. + The input text to parse. + The name of the generated class, overriding whatever is specified in the host. + The namespace in which the generated class will reside. + The file name to use in line pragmas. + A token used to cancel the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a code core. + The results of the generated core. + The input text to parse. + The name of the generated class, overriding whatever is specified in the host. + The namespace in which the generated class will reside. + The file name to use in line pragmas. + A token used to cancel the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the which defines the environment in which the generated template code will live. + The which defines the environment in which the generated template code will live. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer and returns its result. + The resulting parse tree. + The input text to parse. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer and returns its result. + The resulting parse tree. + The input text to parse. + A token used to cancel the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer and returns its result. + The resulting parse tree. + The input text to parse. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer and returns its result. + The resulting parse tree. + The input text to parse. + A token used to cancel the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template core. + The resulting parse tree. + The input text to parse. + A token used to cancel the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the state of the machine. + The generic type Return. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the current state of the machine. + The current state of the machine. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the starting state of the machine. + The starting state of the machine. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Stays into the machine during the transition. + Transition of the state machine. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Stays into the machine during the transition with the specified output. + The output of the transition. + The output. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Disables the machine upon transition. + The machine to stop. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the new transition of the state. + The new transition of the state. + The new state. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the new transition of the state with the specified output. + The new transition of the state with the specified output. + The output. + The new state. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Describes the turning process of the state. + The turning process of the state. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the state result. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The next output. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The output. + The next state. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the state has output. + true if the state has output; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the next state in the machine. + The next state in the machine. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the output. + The representing the output. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a language generator and provider of the VB razor code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the type of CodeDomProvider. + The type of CodeDomProvider. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates the code language generator. + The code language generator. + The name of the class. + The root namespace name. + The source File name. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a code parser in a . + A code parser in a . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the language name. + The language name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the editing result of the Editor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The partial parse result. + The edited span builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the edited span of the . + The edited span of the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the partial parse result. + The partial parse result. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides edit handler for implicit expression. + + + Initializes a new instance of the class. + The tokenizer. + The keywords. + true to accept trailing dot; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the expression accepts trailing dot. + true if the expression accepts trailing dot; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the parse that can accept change. + The partial parse result. + The target. + The normalized change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the specified object is equal to the current object. + true if the specified object is equal to the current objet; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the hash code for this current instance. + The hash code for this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the keywords associated with the expression. + The keywords associated with the expression. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of this current instance. + A string representation of this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the handler editor for this webpages. + + + Initializes a new instance of the class. + The tokenizer symbols. + + + Initializes a new instance of the class. + The tokenizer symbols. + The accepted characters. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Provides methods for handling the span edits. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The method used to parse string into tokens. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The method used to parse string into tokens. + One of the values of the enumeration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets a value that specifies the accepted characters. + One of the values of the enumeration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Applies the text change to the span. + The result of the apply operation. + The span to apply changes to. + The change to apply. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Applies the text change to the span. + The result of the apply operation. + The span to apply changes to. + The change to apply. + true to accept partial result; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the span can accept the specified change. + true if the span can accept the specified change; otherwise, false. + The span to check. + The change to apply. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new default span edit handler. + A newly created default span edit handler. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new default span edit handler. + A newly created default span edit handler. + The method used to parse string into tokens. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the editor hints. + The editor hints. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether this instance is equal to a specified object. + true if the object is equal to the this instance; otherwise, false. + The object to compare with this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the old text from the span content. + The old text from the span content. + The span to get old text from. + The text change which contains the location of the old text. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end of first line of the span content. + true if the specified change is at the end of first line of the span content; otherwise, false. + The span to check. + The change to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end of the span. + true if the specified change is at the end of the span; otherwise, false. + The span to check. + The change to chek. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end the span content and for deletion. + true if the specified change is at the end the span content and for deletion; otherwise, false. + The span to check. + The change to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end the span content and for insertion. + true if the specified change is at the end the span content and for insertion; otherwise, false. + The span to check. + The change to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end the span content and for replacement. + true if the specified change is at the end the span content and for replacement; otherwise, false. + The span to check. + The change to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the span owns the specified change. + true if the span owns the specified change; otherwise, false. + The span to check. + The change to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the method used to parse string into tokens. + The method used to parse string into tokens. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation of the span edit handler. + The string representation of the span edit handler. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Updates the span using the normalized change. + The new span builder for the specified target. + The span to update. + The normalized change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the added import code generator for the razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The string namespace. + The length of the keyword namespace. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether two object instances are equal. + true if the specified object is equal to the current object; otherwise, false. + The object to compare with the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code with the specified parameters using the added import code generator. + The target span. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the string namespace of the generator to add import code generator. + The string namespace of the generator to add import code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the length of keyword namespace for the code generator. + The length of keyword namespace for the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string that represents the current object. + A string that represents the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the attributes of the block code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The name. + The prefix string. + The suffix string. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare with the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to end the block using the specified parameters. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to start the block using the specified parameters. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this code generator. + The hash code for this code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the string name of the . + The string name of the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the prefix of the code generator. + The prefix of the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the suffix for the code generator. + The suffix for the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string that represents the current object. + A string that represents the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represent the block code generator for this razor syntax. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare with the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the end of the block code generator for this razor syntax. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start of the block code generator for this razor syntax. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a hash code for the block code generator. + A hash code for the block code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a null value for the block code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the completion of event arguments for the code generation. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The virtual path string. + The physical path string. + The generated code compile unit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the generated code to complete the event argument. + The generated code to complete the event argument. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the physical path for the code generation. + The physical path for the code generation. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the virtual path of the code generation. + The virtual path of the code generation. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents the context of the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a new generated code mapping to the collection. + The collection index of the newly added code mapping. + The source location of the generated code mapping. + The code start of the generated code mapping. + The length of the generated code mapping. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a code statement for a context call on the specified method. + The content span. + The name of the method to invoke a context call. + true to specify that the method parameter is literal; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a code statement that inserts the Razor design time helpers method in the specified code statement. + The code statement that receives the code insertion. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds the specified code statement to the body of the target method. + The code statement to add the target method. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds the specified code statement to the body of the target method. + The code statement to add the target method. + The line pragma. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Appends the specified fragment to the current buffered statement. + The fragment to add. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Appends the specified fragment to the current buffered statement. + The fragment to add. + The source span for the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Appends the content of the span to the current buffered statement. + The source span whose content is to be added. + + + Assigns a new statement collector and returns a disposable action that restores the old statement collector. + A disposable action that restores the old statement collector. + The new statement collector. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the dictionary collection of generated code mapping. + The dictionary collection of generated code mapping. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the code compile unit that will hold the program graph. + The code compile unit that will hold the program graph. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new instance of the class. + The newly created instance of the code generator context. + The Razor engine host. + The class name for the generated class type declaration. + The name for the generated namespace declaration. + The source file. + true to enable the generation of line pragmas; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the current buffered statement. + The current buffered statement. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds the expression helper variable to the generated class if not yet added, + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Flushes the current buffered statement. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the generated class type declaration. + The generated class type declaration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the line pragma for the specified source. + The line pragma for the specified source. + The source span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the line pragma for the source. + The line pragma for the specified source. + The source span. + The start index of code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the line pragma for the source. + The line pragma for the specified source. + The source span. + The start index of code. + The length of code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the line pragma for the source. + The line pragma for the specified source. + The source location. + The start index of code. + The length of code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the Razor engine host. + The Razor engine host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Marks the end of generated code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Marks the start of generated code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the generated namespace declaration. + The generated namespace declaration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the source file. + The source file. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the generated member method. + The generated member method. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the name of text writer. + The name of text writer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a Razor code generator for C# language. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The class name for the generated class type declaration. + The name for the generated namespace declaration. + The source file. + The Razor engine host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes the context for this code generator. + The context for this code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the dynamic attributes of the block code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instances of the class. + The prefix. + The offset values. + The line values. + The col. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instances of the class. + The string prefix. + The value start. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare with the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to end the block using the specified parameters. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to start the block using the specified parameters. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the namespace prefix of the code generator. + The namespace prefix of the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string that represents the current object. + A string that represents the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the value start for the dynamic attribute block code generator. + The value start for the dynamic attribute block code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a code generator for expression. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether this instance and a specified object are equal. + true if and this instance are the same type and represent the same value; otherwise, false. + The object to compare with the current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the expression. + The source span whose content represents an expression. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the end code for the block. + The target block for the end code generation. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start code for the block. + The target block the start code generation. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the string representation of this instance. + The string representation of this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a generated class context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The execute method name. + The write method name. + Write literal method name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + Execute method name. + Write method name. + Write literal method name. + Write to method name. + Write literal to method name. + Template type name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + Execute method name. + Write method name. + Write literal method name. + Write to method name. + Write literal to method name. + Template type name. + Define section method name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + Execute method name. + Write method name. + Write literal method name. + Write to method name. + Write literal to method name. + Template type name. + Define section method name. + Begin context method name. + End context method name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the context allows sections. + true if the context allows sections; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the context allows templates. + true if the context allows templates; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method before the generated context. + The name of the method before the generated context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default generated context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the execute method. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the layout property. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the write attribute method. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the write to attribute to method. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Specifies the default name of the write literal method. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Specifies the default name of the write method. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that defines the section of the context. + The name of the method that defines the section of the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method after the generated context. + The name of the method after the generated context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that will be invoked on the context. + The name of the method that will be invoked on the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this current instance. + The hash code for this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the property name for the layout. + The property name for the layout. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are equal. + true if the two object are equal; otherwise, false. + The first object to compare. + The second object to compare. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are not equal. + true if the two object are not equal; otherwise, false. + The first object to compare. + The second object to compare. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that resolves a Url for the context. + The name of the method that resolves a Url for the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the generated class supports instrumentation. + true if the generated class supports instrumentation; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the type name for the template. + The type name for the template. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that writes an attribute. + The name of the method that writes an attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method where to write an attribute. + The name of the method where to write an attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method where to write literal for the context. + The name of the method where to write literal for the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method where to write literal for the context. + The name of the method where to write literal for the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that will write on the context. + The name of the method that will write on the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that will write on the context. + The name of the method that will write on the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the generated code mapping objects. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The starting line. + The starting column. + The start generated column. + The code length. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The start offset. + The starting line. + The starting column. + The start generated column. + The code length. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the length of the generated map codes. + The length of the generated map codes. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current generated code mapping object. + true if the specified object is equal to the current generated code mapping object; otherwise, false. + The object to compare with the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for the generated code mapping object. + The hash code for the generated code mapping object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two specified generated code mapping objects have the same value. + true if the two specified generated code mapping objects have the same value; otherwise, false. + The left generated code mapping objects. + The right generated code mapping objects. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two specified generated code mapping objects have different values. + true the two specified generated code mapping objects have different values; otherwise, false. + The right generated code mapping objects. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the starting column of the generated code maps. + The starting column of the generated code maps. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the starting column of a generated code maps in the generated source file. + The starting column of a generated code maps in the generated source file. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the starting line of the generated code maps. + The starting line of the generated code maps. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the starting offset of the generated code maps. + The starting offset of the generated code maps. + + + Returns a string that represents the current object. + A string that represents the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a helper code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The signature. + true to complete the header; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the footer for this code. + The footer for this code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a block after the code. + The block to generate. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a block before the code. + The block to generate. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the hash code for the current instance. + The hash code for the current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the header for this code is complete. + true if the header for this code is complete; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the signature for this code. + The signature for this code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the current instance. + A string representation of the current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a hybrid code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the data model from switches identified by parameters. + The target object. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates an end block code. + The target object. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start block code. + The target object. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the for the webpages. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the end block code for the razor. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start block code for the razor. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a phase of the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the data model with the specified target and context. + The target object. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for literal attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. . Initializes a new instance of the class. + The prefix of the literal attribute. + The value of the literal attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. . Initializes a new instance of the class. + The prefix of the literal attribute. + The value generator for the literal attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. + true if the specified object is equal to this instance; otherwise, false. + The object to compare to this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for the literal attribute. + The source span whose content represents the literal attribute. + The context of the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the hash code for the current instance. + The hash code for the current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the prefix of the literal attribute. + The prefix of the literal attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation of this instance. + The string representation of this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the value of the literal attribute. + The value of the literal attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the value generator for the literal attribute. + The value generator for the literal attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for markup. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. + true if the specified object is equal to this instance; otherwise, false. + The object to compare to this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for the markup. + The source span whose content represents the markup. + The context of the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation for this instance. + The string representation for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a Razor code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The class name. + The root namespace name. + The source file name. + The host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the class name for this code. + The class name for this code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the context of this code generator. + The context of this code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the code generator is in design-time mode. + true if the code generator is in design-time mode; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the generator should generate line pragmas in the Razor code. + true if the generator should generate line pragmas in the Razor code; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the razor engine host. + The razor engine host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes the current instance. + The context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Raises the Complete event. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the root namespace. + The name of the root namespace. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the source file. + The name of the source file. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the end block. + The block to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the span. + The span to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the start block. + The block to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the razor comment code generator for the webpages. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start block code with the specified parameters. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for Razor directive attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The name of the directive attribute. + The value of the directive attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. + true if the specified object is equal to this instance; otherwise, false. + The object to compare to this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for the directive attribute. + The source span whose content represents the directive attribute to generate. + The context of the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the name of the directive attribute. + The name of the directive attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation for this instance. + The string representation for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the value of the directive attribute. + The value of the directive attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the resolve Url code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether this instance and a specified object are equal. + true if and this instance are the same type and represent the same value; otherwise, false. + The object to compare with the current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the Url. + The target object. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the fully qualified type name of this instance. + The fully qualified type name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a section code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The name of the section code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a block after the section code. + The target to generate. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a block before the section code. + The target to generate. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the hash code for this current instance. + The hash code for this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the section. + The name of the section. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of this current instance. + A string representation of this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for set base type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The set base type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the set base type. + The set base type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. + true if the specified object is equal to this instance; otherwise, false. + The object to compare to this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for this set base type. + The source span that contains the set base type to generate code. + The context of the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the hash code for this current instance. + The hash code for this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Resolves the given set base type. + The resolved set base type. + The context of the code generator. + The set base type to resolve. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation for this instance. + The string representation for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a code generator that sets layout for the web Razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The layout path. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a layout code. + The target where to generate the code. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves a hash code for this current instance. + A hash code for this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the path of the layout code. + The path of the layout code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of this current instance. + A string representation of this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the conversion of the SetVBOptionCodeGenerator of the value. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The option name. + true if the object has a value; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Converts the explicitly to the on and off value. + The explicitly converts to the on and off value. + true if the converts to on and off value; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the explicit code Dom option name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the specified parameters. + The target. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the option name for the code generator. + The option name for the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Strictly converts the to the on and off value. + The strictly converts to the on and off value. + true if the strictly converts to the on and off value; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the strict code Dom option name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a String that represents the current Object. + A String that represents the current Object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the has a value. + true if the has a value; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the span code generator for the razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare with the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a code for the specified target and context parameters. + The target span. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a hash code for the span code generator. + A hash code for the span code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a null value for the span code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for the statement. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. + true if the specified object is equal to this instance; otherwise, false. + The object to compare to this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for the statement. + The span source whose content contains the statement to generate. + The context of the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this current instance. + The hash code for this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation for this instance. + The string representation for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the template block code generator of the razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to end the block of the template block code generator. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to start the block for the template block code generator. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a type member code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code with a given target and context. + The target where to generate the code. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the hash code for this current instance. + The hash code for this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of this code. + A string representation of this code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the razor code generator for VB. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The name of the class. + The root namespace. + The file name of the asset source. + The host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a visitor that executes a callback upon the completion of a visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The delegate for the span visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The delegate for the span visit. + The delegate for the error visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The delegate for the span visit. + The delegate for the error visit. + The delegate for the start block visit. + The delegate for the end block visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The delegate for the span visit. + The delegate for the error visit. + The delegate for the start block visit. + The delegate for the end block visit. + The delegate to execute for the complete event. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the synchronization context for this callback visitor. + The synchronization context for this callback visitor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Executes the visitor callback to visit the end block. + The end block to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Executes the visitor callback to visit the error. + The Razor error to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Executes the visitor callback to visit the span. + The span to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Executes the visitor callback to visit the start block. + The start block to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a C sharp code parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts the ‘IF’ keyword. + true if the parser accepts the ‘IF’ keyword; otherwise, false. + The keyword to accept. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Asserts a directive code. + The directive code to assert. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code contains ‘AT’ keyword. + true if the code contains ‘AT’ keyword; otherwise, false. + The keyword. + + + Indicates the base type directive. + The no type name error. + The create code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the functions directive. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the code that handles embedded transition. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a helper directive. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates which class the application will derive the view from, and can therefore ensure proper type checking. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Inherits a directive core. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is at embedded transition. + true if the code is at embedded transition; otherwise, false. + true to allow templates and comments; otherwise, false. + true to allow transitions; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the code is nested. + true if the code is nested; otherwise, false. + + + Indicates whether the lines and comments is spacing token. + The function that indicates the spacing token. + true to include new lines; otherwise, false. + true to include comments; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the C sharp language keywords. + The C sharp language keywords. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the specific language for parsing. + The specific language for parsing. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the layout directive. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Maps the given directives. + The handler. + The directives. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the other parser used for the code. + The other parser used for the code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Spans the output of the parsing before the comment. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Blocks the parsing. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the reserved directive. + Determines whether the directive is a top level. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a section directive. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a session state directive. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the session state directive core. + + + Indicates the directive for session state type. + The no value error. + The create code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a directive handler. + true if successful; otherwise, false. + The directive. + The handler. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the value of the session state is valid. + true if the value of the session state is valid; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the block for this CSharpCode parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The string name. + The start of the source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The CSharp symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the string name for the block. + The string name for the block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the source location to start the block. + The source location to start the block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the different language characteristics in a CSharp language. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a marker symbol in the code. + A marker symbol in the code. + The source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a symbol in the code. + A symbol in the code. + The source location. + The content value. + The html symbol type. + List of errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a language tokenizer. + A language tokenizer. + The source of the text document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Flips the bracket symbol in the code. + The bracket symbol in the code. + The symbol bracket. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the keyword in the code. + The keyword in the code. + The keyword. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the in the code. + The in the code. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a sample symbol in the code. + A sample symbol in the code. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a sample symbol in the code. + A sample symbol in the code. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the instance for the class. + The instance for the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the different language characteristics in an html. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a marker symbol in the Html. + A marker symbol in the Html. + The source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a symbol in the Html. + A symbol in the Html. + The source location. + The content value. + The html symbol type. + List of errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates an html tokenizer. + An html tokenizer. + The source of the text document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Flips the bracket symbol in the html. + The bracket symbol in the html. + The symbol bracket. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the in the html. + The in the html. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a sample symbol in the html. + A sample symbol in the html. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the instance for the class. + The instance for the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a parser specifically for parsing HTML markup. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Builds the span for the given content using the specified span builder. + The span builder used to build the span. + The start location. + The span content. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the function delegate used to determine the token used for HTML spacing. + The function delegate used to determine the token used for HTML spacing. + true to indicate that new lines are considered as spacing token; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the instance that defines the characteristics of HTML language. + The instance that defines the characteristics of HTML language. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the other parser for parsing HTML markup. + The other parser for parsing HTML markup. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Builds the span before the Razor comment. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Parses the next HTML block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Parses the HTML document. + + + Parses a section with markups given by the nesting sequences. + A tuple that specifies the markup nesting sequences. + true to indicate case-sensitive parsing; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Skips the parse until the specified condition is meet. + A function delegate that defines the condition. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Skips the parse until the specified HTML symbol type is encountered. + The HTML symbol type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the HTML tags that are considered as void. + The HTML tags that are considered as void. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Provides methods that define the behavior of a Razor code language. + The type of the code tokenizer for the Razor language. + The type for the language symbol. + The enumeration type for the language symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a code language symbol with the specified source location as the start marker. + The symbol for the code language. + The source location as the start marker. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a code language symbol with the specified source location with the specified source location as the start marker. + The symbol for the code language. + The source location as the start marker. + The content. + The enumeration type for the language symbol. + The collection of error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a Razor code language tokenizer for the specified source document. + A Razor code language tokenizer for the specified source document. + The source document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the opposite bracket symbol for the specified bracket symbol. + The opposite bracket symbol for the specified bracket symbol. + The bracket symbol to flip. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the specific language symbol type for the given symbol type. + The specific language symbol type for the given symbol type. + The symbol type to get. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the actual symbol for the given language symbol type. + The actual symbol for the given language symbol type. + The language symbol type to get. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a comment body type. + true if the symbol is a comment body type; otherwise, false. + The symbol to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a comment star type. + true if the symbol is a comment star type; otherwise, false. + The symbol to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a comment start type. + true if the symbol is a comment start type; otherwise, false. + The symbol to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is an identifier type. + true if the symbol is an identifier type; otherwise, false. + The symbol to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a keyword type. + true if the symbol is a keyword type; otherwise, false. + The symbol to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol type is a known symbol type. + true if the symbol type is a known symbol type; otherwise, false. + The symbol whose type is to be checked. + The known type of the symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a new line type. + true if the symbol is a new line type; otherwise, false. + The symbol to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a transition type. + true if the symbol is a transition type; otherwise, false. + The symbol to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is an unknown type. + true if the symbol is an unknown type; otherwise, false. + The symbol to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a whitespace type. + true if the symbol is a whitespace type; otherwise, false. + The symbol to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is an unknown type. + true if the symbol is an unknown type; otherwise, false. + The known type of the symbol. + + + Splits the content of the code language symbol at the specified index. + A tuple of code language symbol. + The symbol whose content is to be splitted. + The index where the split occurs. + The enumeration type for the language symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Splits the specified string into tokens. + The collection of token. + The string to tokenize. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Splits the specified string into tokens. + The collection of token. + The source location as the start marker for the tokenizer. + The string to tokenize. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the parser base class for the razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Builds a span for the parser base. + The span builder. + The beginning of the source location. + The content. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the . + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the parser is a markup parser. + true if the parser is a markup parser; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the other parser . + The other parser . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Blocks the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates documentation for the parse. + + + Parses the section in ordered list of the elements. + The pair of nesting sequences. + true if the case is sensitive; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a parser whose context can be switched to either a code or a markup. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The source document. + The code parser for the context. + The markup parser for the context. + The active parser for the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the active parser for the context. + The active parser for the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds the specified span at the end of the block builder stack. + The span to add. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the code parser for the context. + The code parser for the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Parses the last span and returns the parse results that contain the newly built block. + The parse results that contain the newly built block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the current block builder. + The current block builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the current character available from the source. + The current character available from the source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets a value that indicates whether the parser is in design mode. + true if the parser is in design mode; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates an end block from the last item of the block builder stack. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets a value that indicates whether the source status is end of file. + true if the source status is end of file; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the list of errors during parsing. + The list of errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified block type exists in the block builder list. + true if the specified block type exists in the block builder list; otherwise, false. + The block type to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the last accepted characters. + One of the values of the enumeration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the last span. + The last span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the markup parser for the context. + The markup parser for the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Occurs when parse encountered error. + The source location. + The error message. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Occurs when parse encountered an error. + The source location. + The error message. + The other information about the source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the text reader for the source document. + The text reader for the source document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a new block builder at the end of the block builder stack and returns a disposable action that returns an end block. + A disposable action that returns an end block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a new block builder at the end of the block builder stack and returns a disposable action that returns an end block. + A disposable action that returns an end block. + The type for the new block builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Alternately switches the code parser or markup parser as the active parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets a value that indicates whether white space is significant to ancestor block. + true is white space is significant to ancestor block; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Provides helper methods for the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a spacing combining mark or a non-spacing mark. + true if the specified character value is a spacing combining mark or a non-spacing mark; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a connector punctuation. + true if the specified character value is a connector punctuation; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a decimal digit number. + true if the specified character value is a decimal digit number; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is valid for use in email address. + true if the specified character value is valid for use in email address; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is used for formatting text layout or formatting text operation. + true if the specified character value is used for formatting text layout or formatting text operation.; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a hexadecimal digit number. + true if the specified character is a hexadecimal digit number; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified string value is an identifier. + true if the specified string value is an identifier; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified string value is an identifier. + true if the specified string value is an identifier; otherwise, false. + The value to check. + true to require that the identifier starts with a letter or underscore (_); otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is valid for use in identifier. + true if the specified character is valid for use in identifier; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is valid for use as start character of an identifier. + true if the specified character value is valid for use as start character of an identifier; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a letter. + true if the specified character is a letter; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a letter or a decimal digit number. + true if the specified character is a letter or a decimal digit number; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified value is a newline. + true if the specified character is a newline; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified value is a newline. + true if the specified character is a newline; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a terminating character token. + true if the specified character value is a terminating character token; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a terminating quoted string. + true if the specified character value is a terminating quoted string; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a whitespace. + true if the specified character value is a whitespace; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a whitespace or newline. + true if the specified character value is a whitespace or newline; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Sanitizes the specified input name to conform as a valid value for class name. + The sanitized class name. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a parser visitor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the cancellation token. + The cancellation token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates that a visitor method has completed execution. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the specified block. + The block to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the specified black after parsing. + The block to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the given razor error. + The error to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the specified span. + The span to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the specified block before parsing. + The block to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides extension methods for parser visitor. + + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a Razor parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The code parser. + The markup parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. + The created . + The object to parse. + The span callback. + The error callback. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. + The created . + The object to parse. + The span callback. + The error callback. + The cancellation token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. + The created . + The object to parse. + The span callback. + The error callback. + The context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. + The created . + The object to parse. + The span callback. + The error callback. + The context. + The cancellation token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. + The created . + The object to parse. + The consumer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the design time mode. + The design time mode. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. + The parser result. + The object to parse. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. + The object to parse. + The visitor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. + The parser result. + The object to parse. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. + The parser result. + The object to parse. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. + The object to parse. + The visitor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a tokenizer backed parser. + The type of tokenizer. + The type of symbol. + The type of SymbolType. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the list of symbols + The list of symbols. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the specified symbol. + The symbol to accept. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts all types of tokenizer. + true of the parser accepts all types of tokenizer; otherwise, false. + The types. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts and moves to the next tokenizer. + true if the parser accepts and moves to the next tokenizer; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts single whitespace character. + true if the parser accepts single whitespace character; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token until a token of the given type is found. + The type of the token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token until a token of the given type is found and it will backup so that the next token is of the given type. + The type of the first token. + The type of the second token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the given tokens until a token of the given type is found. + The type of the first token. + The type of the second token. + The type of the third token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token until a token of the given types is found. + The types of the token. + + + Accepts token while the condition has been reached. + The condition. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the token while a token of the given type is not found. + The type of the token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token while the token of the given type has been reached. + The type of the first token. + The type of the second token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token while the token of the given type has been reached. + The type of the first token. + The type of the second token. + The type of the third token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token while the token of the given types has been reached. + The types. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts whitespace in lines. + true if the parser accepts whitespace in lines; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a marker symbol if necessary. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a marker symbol if necessary. + The location where to add the symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token is at the specified type. + true if the token is at the specified type; otherwise, false. + The type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token is at the specified identifier. + true if the token is at the specified identifier; otherwise, false. + true to allow keywords; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parsing is balance. + true if the parsing is balance; otherwise, false. + The balancing mode. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parsing is balance. + true if the parsing is balance; otherwise, false. + The balancing mode. + The left parse. + The right parse. + The start of the mode. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Builds a specified span. + The span to build. + The start location to build the span. + The content of the span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Configures the span. + The configuration. + + + Configures the span. + The configuration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current location of the current instance. + The current location of the current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current symbol of this instance. + The current symbol of this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the tokenizer is in the end of file. + true if the tokenizer is in the end of file; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether to ensure the current parser. + true if to ensure the current parser; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the expected token with the given type. + The type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the expected token with the given types. + The types. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Handles the embedded transition. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a specified span. + The span to initialize. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether this instance is at embedded transition. + true if this instance is at embedded transition; otherwise, false. + true to allow templates and comments; otherwise, false. + true to allow transitions; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the language used for parsing. + The language used for parsing. + + + Determines whether the token with the given condition would pass. + true if the token with the given condition would pass; otherwise, false. + The condition. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token with the given type would pass. + true if the token with the give type would pass; otherwise, false. + The type of the token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token with the given types would pass. + true if the token with the given types would pass; otherwise, false. + The types. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser advances to the next token. + true if the parser advances to the next token; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether parsing a token with the given type is optional. + true if parsing a token with the given type is optional; otherwise, false. + The type of the token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether parsing a token with the given type is optional. + true if parsing a token with the given type is optional; otherwise, false. + The type of the token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Outputs a token with accepted characters. + The accepted characters. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Outputs a token with span kind. + The span kind. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Outputs a token with a given span kind and accepted characters. + The span kind. + The accepted characters. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Outputs a span before the razor comment. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code..Gets the previous symbol of this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Pushes the span configuration. + An that shuts down the configuration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Pushes the span configuration. + An that shuts down the configuration. + The new configuration. + + + Pushes the span configuration. + An that shuts down the configuration. + The new configuration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts the transition back. + The symbols. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts the transition back. + The symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts the current transition back. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Displays the razor comment. + + + Reads a token while the condition is not reached. + The token to read. + The condition. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the expected token is required. + true if the expected token is required; otherwise, false. + The expected token. + true to display an error if not found; otherwise, false. + The error base. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the associated with this instance. + The associated with this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the span configuration. + The span configuration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the tokenizer. + The tokenizer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token with the given type was parsed. + true if the token with the given type was parsed; otherwise, false. + The type of the token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a Visual Basic code parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts spaces in the VB code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Checks for a condition and displays a keyword in the code. + The keyword. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Asserts the given directive. + The directive to assert. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the directive is ‘AT’ directive. + true if the directive is an ‘AT’ directive; otherwise, false. + The directive. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the given keyword is ‘AT’. + true if the given keyword is ‘AT’; otherwise, false. + The keyword. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Ends a terminated directive. + The function that ends the terminated directive. + The directive. + The block type. + The code generator. + true to allow markup; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the termination of directive body is ended. + true if the termination of directive body is ended; otherwise, false. + The directive. + The block start. + true to allow all transitions; otherwise, false. + + + Ends a termination of statement. + The function that ends the termination. + The keyword. + true if the termination supports exit; otherwise, false. + true if the termination supports continue; otherwise, false. + + + Ends a termination of statement. + The function that ends the termination. + The keyword. + true if the termination supports exit; otherwise, false. + true if the termination supports continue; otherwise, false. + The block name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Handles the embedded transition. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Handles the embedded transition. + The last white space. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the code that handles the Exit or Continue keyword. + The keyword. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a code that handles a transition. + The last white space. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the code is a helper directive. + true if the code is a helper directive; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code imports a statement. + true if the code imports a statement; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code inherits a statement. + true if the code inherits a statement; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is at embedded transition. + true if the code is at embedded transition; otherwise, false. + true to allow templates and comments; otherwise, false. + true to allow transitions; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is directive defined. + true if the code is directive defined; otherwise, false. + The directive. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the keywords associated with the code. + The keywords associated with the code. + + + Indicates a keyword that terminates a statement. + The function that terminates the statement. + The start. + The terminator. + true if the termination supports exit; otherwise, false. + true if the termination supports continue; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the language for the parser. + The language for the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is a layout directive. + true if the code is a layout directive; otherwise, false. + + + Maps a given directive. + The directive. + The action whether to map a given directive. + + + Maps a given keyword. + The keyword. + The action whether to map a given keyword. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a nested block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the keyword from the code is optional. + true if the keyword from the code is optional; otherwise, false. + The keyword. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is an option statement. + true if the code is an option statement; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the other parser. + The other parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the parser block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the parser block. + The start sequence. + The end sequence. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Spans the output before Razor comment. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Blocks the parsing. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads a list of Visual Basic spaces. + A list of Visual Basic spaces. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the expected symbol is required. + true if the expected symbol is required; otherwise, false. + The expected symbol. + The error base. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is a reserved word. + true if the code is a reserved word; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is a section directive. + true if the code is a section directive; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code has a session state directive. + true if the code has a session state directive; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the characteristics of the Visual Basic language. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a Visual Basic marker symbol. + The created Visual Basic marker symbol. + The location to create the symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a Visual Basic symbol. + The created . + The location to create the symbol. + The content. + The type of the symbol. + The errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a Visual Basic tokenizer. + The created . + The source where to create the tokenizer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Flips the given bracket. + The type of the Visual Basic symbol. + The bracket to flip. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the type of the known symbol. + The type of the known symbol. + The type to retrieve. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a sample symbol with the given type. + A sample symbol with the given type. + The type of the symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets an instance of this . + An instance of . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the auto-complete editing handler class. + + + Initializes a new instance of the class. + The tokenizer. + + + Initializes a new instance of the class. + The tokenizer. + The accepted characters. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the auto-complete function is at the end of this span. + true if the auto-complete function is at the end of this span; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a string value to auto-complete. + A string value to auto-complete. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a parse result that can accept changes. + The phase of the target. + The normalized . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether this instance and a specified object are equal. + true if and this instance are the same type and represent the same value; otherwise, false. + The object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. + A 32-bit signed integer that is the hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the fully qualified type name of this instance. + A String containing a fully qualified type name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the block for creating webpages. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The source for the block builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the parser visitor of the block. + The parser visitor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a collection of SyntaxTreeNode to view the children of the block. + A collection of SyntaxTreeNode to view the children of the block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the IBlockCodeGenerator to generate codes for the elements. + The IBlockCodeGenerator to generate codes for the elements. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current block. + true if the specified object is equal to the current block; otherwise, false. + The object to compare with the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a value indicating whether the block is equivalent to the same element. + true if the block is equivalent to the same element; otherwise, false. + The syntax tree node. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Finds the first descendent span of the block. + The first descendent span of the block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Finds the last descendent span of the block. + The last descendent span of the block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Flattens a collection of a specified type for the block. + A collection of a specified type for the block to flatten. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the object is a block-level object. + true if the object is a block-level object; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the length value of the block. + The length value of the block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Locates the owner of the block. + The owner of the block to locate. + The text change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the string name of the block. + The string name of the block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the start to identify the specific location of the block. + The start to identify the specific location of the block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string that represents the current object. + A string that represents the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the type of code block. + The type of code block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the block builder for the webpages. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The original block builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Builds a block for this instance. + A block builds for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the collection of child elements of the block builder. + The collection of child elements of the block builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the code generator for the block builder. + The code generator for the block builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the string name for the block builder. + The string name for the block builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Resets the block builder to its original position. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a block type that can be assigned null. + A block type that can be assigned null. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a parsing error in Razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The error message. + The absolute index of the source location. + The line index of the source location. + The column index of the source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The error message. + The absolute index of the source location. + The line index of the source location. + The column index of the source location. + The length for the error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The error message. + The source location of the error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The error message. + The source location of the error. + The length for the error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. + true if the specified object is equal to this instance; otherwise, false. + The object to compare to this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. + true if the specified object is equal to this instance; otherwise, false. + The object to compare to this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for the current instance. + The hash code for the current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the length for the error. + The length for the error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the source location of the error. + The source location of the error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the error message. + The error message. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation of this error instance. + The string representation of this error instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a Razor parse tree node that contains the all the content of a block node. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The builder to use for this span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Accepts visit from the specified visitor. + The object that performs the visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Changes the span builder for this span. + A delegate that will be executed along with this change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Sets the start character location of this span. + The new start location to set for this span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the code generator for the span. + The code generator for the span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the content of the span. + The content of the span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the handler for span edits. + The handler for span edits. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this span. + true if the specified object is equal to this span; otherwise, false. + The object to compare to this span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified node is equivalent to this span. + true if the specified node is equal to this span; otherwise, false. + The node to compare with this span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this current span. + The hash code for this current span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets a value that indicates whether this node is a block node. + false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the kind for this span. + One of the values of the enumeration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the length of the span content. + The length of the span content. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the next span in the tree node. + The next span in the tree node. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the previous span in the tree node. + The previous span in the tree node. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Replaces the span builder for this span with the specified span builder. + The new builder to use for this span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the start character location of the span. + The start character location of the span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the symbols used to generate the code for the span. + The symbols used to generate the code for the span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation of this current span. + The string representation of this current span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the span builder for the syntax tree. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The original span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the given symbol for the span builder. + The symbol builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Builds a span builder for this instance. + A span builder for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Clears the symbols of the span builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the span code generator. + The span code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the span edit handler of the builder. + The span edit handler of the builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the span kind of the span builder. + The span kind of the span builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Resets the span builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the source location of the span builder. + The source location of the span builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the symbols for a generic read-only collection. + The symbols for a generic read-only collection. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the node for the syntax tree. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the visitor of the tree node. + The parser visitor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the syntax tree node is equivalent to given node. + true the syntax tree node is equivalent to given node; false. + The given node. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the syntax tree node is a block-level object. + true if the syntax tree node is a block-level object; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the length of the syntax tree node. + The length of the syntax tree node. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the parent tree node of the current tree node. + The parent tree node of the current tree node. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the specific source location for the syntax tree node. + The specific source location for the syntax tree node. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Provides a lookahead buffer for the text reader. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The text reader for the buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Begins the lookahead buffering operation for this . + A disposable action that ends the lookahead buffering. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Discards the backtrack context associated the lookahead buffering operation. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the current character in the buffer. + The current character in the buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the current location of the character in the buffer. + The current location of the character in the buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Releases the unmanaged resources used by the current instance of this class, and optionally releases the managed resources. + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Reads the next character from the text reader and appends it to the lookahead buffer. + true if a character was read from the text reader; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Advances the buffer position to the next character. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the current character in the buffer. + The current character in the buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the current character from the buffer and advances the buffer position to the next character. + The current character from the buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a location tagged. + The type of the location tagged. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The value of the source. + The offset. + The line. + The column location of the source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The value of the source. + The location of the source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for the current instance. + The hash code for the current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the location of the source. + The location of the source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are equal. + true if the two object are equal; otherwise, false. + The first object to compare. + The second object to compare. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Converts the specified value to a object. + true if successfully converted; otherwise, false. + The value to convert. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are not equal. + true if the two object are not equal; otherwise, false. + The first object to compare. + The second objet to compare. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the current instance. + The string that represents the current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the current instance. + A string that represents the current instance. + The format. + The format provider. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the value of the source. + The value of the source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the token to look for the razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The action to cancel. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases the resources used by the current instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases the unmanaged resources used by the and optionally releases the managed resources. + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a reader + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The source reader. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The string content. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The text buffering. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the length of the text to read. + The length of the text to read. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the source of location for the text reader. + The source of location for the text reader. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads the next character without changing the state of the reader or the character source. + An integer representing the next character to be read. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the position to seek the text reader. + The position to seek the text reader. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads the next character from the text reader and advances the character position by one character. + The next character from the text reader, or -1 if no more characters are available. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The absolute index. + The line index. + The character index. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the absolute index for the source location. + The absolute index for the source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds the two object. + The sum of the two object. + The first object to add. + The second object to add. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Advances the specified object to the given location. + The source location. + The location where to advance the object. + The text that advances to the given location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the character index for the source location. + The character index for the source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Compares current object to the other object. + The value of the objects compared. + The object to compare. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the current object is equal to the other object. + true if the current object is equal to the other object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the line index for the source location. + The line index for the source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds the two object. + The that is the sum of the two object. + The object to add. + The object to add. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two objects are equal. + true if the two objects are equal; otherwise, false. + The first object to compare. + The second object to compare. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the first object is greater than the second object. + true if the first object is greater than the second object; otherwise, false. + The first object. + The second object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are not equal. + true if the two objects are not equal; otherwise, false. + The object to compare. + The object to compare. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the first object is less than the second object. + true if the first object is greater than the second object; otherwise, false. + The first object. + The second object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + Returns . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Subtracts the first object to the second object. + The difference of the two objects. + The first object. + The second object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the source location. + A string representation of the source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides a source location tracker. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The current location of the source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Calculates the new location of the source. + The new source location. + The last position. + The new content. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the current location of the source. + The current location of the source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Updates the source location. + The character to read. + The character to update. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Updates the location of the source. + The object. + The content of the source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides a reader for text buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The text buffer to read. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Begins reading the current text buffer. + An instance that stops the text buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Cancels backtrack. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current location of the text buffer. + The current location of the text buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases the unmanaged resources used by the class and optionally releases the managed resources. + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the next text buffer to read. + The next text buffer to read. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads the current text buffer. + The current text buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Describes a text change operation. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The position of the text change in the snapshot immediately before the change. + The length of the old text. + An old text buffer. + The position of the text change in the snapshot immediately after the change. + The length of the new text. + A new text buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Applies the specified text change. + A string that contains the value of the text. + The content of the text. + The change offset. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Applies the specified text change. + A string that contains the value of the text. + The span of the text change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the hash code for this text change. + The hash code for this text change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether this text change is a delete. + true if this text change is a delete; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether this text change is an insert. + true if this text change is an insert; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether this text change is a replace. + true if this text change is a replace; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a new text buffer. + A new text buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the length of the new text. + The length of the new text. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the position of the text change in the snapshot immediately after the change. + The position of the text change in the snapshot immediately after the change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the text that replaced the old text. + The text that replaced the old text. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a normalized value of this text change. + A normalized value of this text change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets an old text buffer. + An old text buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the length of the old text. + The length of the old text. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the position of the text change in the snapshot immediately before the change. + The position of the text change in the snapshot immediately before the change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the text that was replaced. + The text that was replaced. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two text change are equal. + true if the two text change are equal; otherwise, false. + The left text change. + The right text change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two text change are not equal. + true if the two text change are not equal; otherwise, false. + The left text change. + The right text change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the text change. + A string representation of the text change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides reader for text document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The source to read. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the length of the document. + The length of the document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the location of the document. + The location of the document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the next text document to read. + The next text document to read. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the position of the text document. + The position of the text document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads a specified text document. + The text document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides helper functions for the CSharp tokenizer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified character can be used for identifier. + true if the specified character can be used for identifier; otherwise, false. + The character to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified character can be used as an identifier start character. + true if the specified character can be used as an identifier start character; otherwise, false. + The character to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified character is a literal suffix for real numbers. + true if the specified character is a literal suffix for real numbers; otherwise, false. + The character to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a CSharp tokenizer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a CSharp tokenizer symbol. + A CSharp tokenizer symbol. + The beginning of the source location. + The contents. + The CSharp symbol type. + A collection of razor errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the star type of the . + The star type of the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the razor comment transition type for the . + The razor comment transition type for the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the razor comment type for the . + The razor comment type for the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the state of the machine. + The state of the machine. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the html tokenizer of the razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The source for the text document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a symbol for the specified parameters of the html tokenizer. + A symbol to create for the specified parameters of the html tokenizer. + The source location. + The content string. + The type of html symbol. + The razor errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the html symbols for the razor comment star type. + The html symbols for the razor comment star type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the html symbols for the razor comment transition type. + The html symbols for the razor comment transition type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the html symbols for the razor comment type. + The html symbols for the razor comment type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the start of the state machine for the html. + The start of the state machine for the html. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The type for the language symbol. + The enumeration type for the language symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a result after the razor comment transition. + The result. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the lookahead buffer contains the expected string. + true if the lookahead buffer contains the expected string; otherwise, false. + The string to check. + true to indicate comparison is case sensitive; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the buffer for the tokenizer. + The buffer for the tokenizer. + + + Returns a function delegate, that accepts a character parameter and returns a value that indicates whether the character parameter is equal to specified character or white space. + A function delegate. + The character used to compare. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a language symbol type for the tokenizer with the specified content. + A language symbol type for the tokenizer. + The start of the source location. + The content value. + The symbol type. + The razor error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current character in the tokenizer. + The current character. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a list of the current razor errors. + A list of the current errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current source location. + The current source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current start of the source location. + The current start of the source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value whether the tokenizer current location is at the end of the file. + true if the tokenizer current location is at the end of the file; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the language end symbol type used by the tokenizer. + The language end symbol type. + The start of the source location. + The enumeration type for the language symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the language end symbol type used by the tokenizer. + The language end symbol type. + The enumeration type for the language symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value whether the tokenizer have content. + true if the tokenizer have content; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads to the next character from the code reader. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Shows the next symbol to be used. + The next symbol to be used. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads the next symbol in the code. + The next symbol to read. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the Razor comment body. + The object that represent the state of the result. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the star type for the razor comment. + The star type for the razor comment. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the transition type for the razor comment. + The transition type for the razor comment. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the type of razor comment. + The type of razor comment. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Sets the tokenizer status to its initial state. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Resumes using the previous language symbol type. + The previous language symbol type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Uses a single type of symbol. + A single type of symbol. + The type of symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the source of the text document. + The source of the source document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the start symbol used in this class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the next language symbol type. + The next language symbol type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Takes the string if found in the lookahead buffer into the tokenizer buffer. + true if the lookahead buffer contains the expected string; otherwise, false. + The string to match. + true to indicate comparison is case sensitive; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the current character into the buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the given input string into the buffer. + true if the whole input string was accepted; false, if only a substring was accepted. + The input string. + true to indicate comparison is case sensitive; otherwise, false. + + + Parses the source document until the condition specified by predicate is met or end file is reached. + true if the predicate condition is met; false if end of file is reached. + The predicate that specifies the processing condition. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the specified parameters for the tokenizer view. + The type tokenizer. + The type symbol. + The token symbol type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The tokenizer view. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current view of the TSymbol. + The current view of the TSymbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the view can reach the end of a file. + true if the view can reach the end of a file; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the tokenizer moves to the next view. + true if the tokenizer moves to the next view; false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts a specified symbol into the tokenizer view. + The symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the source of the text document for the tokenizer view. + The source of the text document for the tokenizer view. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the tokenizer to view the symbols for the razor. + The tokenizer to view the symbols for the razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a set of characters as helpers in VB. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether a specified character is enclosed in double quotation marks ("). + true if the character is enclosed in double quotation marks ("); otherwise, false. + The character. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether a character is in octal digit. + true if a character is in octal digit; otherwise, false. + The character. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether a specified character is enclosed in a single quotation mark ('). + true if the character is enclosed in a single quotation mark ('); otherwise, false. + The character. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Allows an application to break a VB symbol into tokens. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The source of text. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a domain of symbols. + A domain of symbols. + The source location. + The content value. + The . + The razor error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the VB symbol type. + The VB symbol type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the transition style of the VB symbol. + The transition style of the VB symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the razor type comment of the . + The razor type comment of the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the start state of the machine. + The start state of the machine. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a C sharp symbol for the razor tokenizer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The symbol’s offset. + The line. + The column + The content of the symbol. + The type of the symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The symbol’s offset. + The line. + The column + The content of the symbol. + The type of the symbol. + A list of errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The location to start the symbol. + The content of the symbol. + The type of the symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The location to start the symbol. + The content of the symbol. + The type of the symbol. + A list of errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the symbol has an escaped identifier. + true if the symbol has an escaped identifier; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this current instance. + The hash code for this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the language keyword. + The language keyword. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the Html symbols. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The location of the symbol. + The exact line the symbol is found. + The column number the symbol is found. + The content value. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The location of the symbol. + The exact line the symbol is found. + The column number the symbol is found. + The content value. + The . + The razor error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The start of the source location. + The content value. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The start of the source location. + The content value. + The . + The razor error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents an interface for the web razor symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Changes the location of the symbol. + The new location of the symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of the symbol. + The content of the symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the starting offset of the symbol. + The location where to start the document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the location of the symbol. + The location of the symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a new instance of symbols. + The generic type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The source location. + The content value. + The type. + The razor error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Changes the start of the machine. + The new start. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of a . + The content of a . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified Object is equal to the current Object. + true if the specified Object is equal to the current Object; otherwise, false. + The object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the razor error. + The razor error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves a hash code based on the current object. + A hash of the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Starts the time’s offset for the source location. + The document start. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the starting point of the source location. + The starting point of the source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a string representation of the current object. + A string representation of the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a Type that inherits from the base Type. + A Type that inherits from the base Type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the symbol extensions for the web tokenizer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of this class. + The content of this class. + The symbols to provide. + The starting index of the span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of this class. + The content of this class. + The intersection with the given span. + + + Gets the content of this class. + The content of this class. + The intersection with the given span. + A list of chosen symbols. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of this class. + The content of this class. + The provided symbols. + + + Enumerates the list of Visual Basic keywords. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the VB symbol components. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The offset value. + The line value. + The column value. + The content String value. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The offset value. + The line value. + The column value. + The content String value. + The . + List of razor errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The start of the source location. + The content String value. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The start of the source location. + The content String value. + The . + List of razor errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether the current object is equal to the new object. + true if the current object is equal to the new object; otherwise, false. + The object to compare. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. + The hash code to return. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the specified data sample from the object. + The specified data sample from the object. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the keyword used in the VB. + The keyword used. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/packages/Moq.4.1.1309.1617/Moq.4.1.1309.1617.nupkg Binary file src/packages/Moq.4.1.1309.1617/Moq.4.1.1309.1617.nupkg has changed diff -r 000000000000 -r 5bca2d201ad8 src/packages/Moq.4.1.1309.1617/Moq.4.1.1309.1617.nuspec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/packages/Moq.4.1.1309.1617/Moq.4.1.1309.1617.nuspec Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,163 @@ + + + + Moq + 4.1.1309.1617 + Moq: an enjoyable mocking library + Daniel Cazzulino + Daniel Cazzulino + http://www.opensource.org/licenses/bsd-license.php + http://www.moqthis.com/ + false + The most popular and friendly mocking framework for .NET + Version 4.1 +* Added covariant IMock<out T> interface to Mock<T> +* Added It.IsNotNull<T> +* Fix: 'NullReferenceException when subscribing to an event' +* Added overloads to Verify to accept Times as a Method Group +* Feature request: It.IsIn(..), It.IsNotIn(...) +* Corrected Verify method behavior for generic methods calls +* Differentiate verification error from mock crash +* Fix: Adding (and removing) handlers for events declared on interfaces works +when CallBase = true. +* Update to latest Castle +* Fix: Mock.Of (Functional Syntax) doesn't work on properties with non-public setters +* Fix: Allow to use CallBase instead of Returns +* Fix: Solved Multi-threading issue - IndexOutOfRangeException +* Capability of mocking delegates (event handlers) + +Version 4.0 +* Linq to Mocks: Mock.Of<T>(x => x.Id == 23 && x.Title == "Rocks!") +* Fixed issues: + * 87 BadImageFormatException when using a mock with a Visual Studio generated Accessor object + * 166 Unable to use a delegate to mock a function that takes 5 or more parameters. + * 168 Call count failure message never says which is the actual invocation count + * 175 theMock.Object failing on VS2010 Beta 1 + * 177 Generic constraint on interface method causes BadImageFormatException when getting Object. + * 183 Display what invocations were recieved when the expected one hasn't been met + * 186 Methods that are not virtual gives non-sense-exception message + * 188 More Callback Overloads + * 199 Simplify SetupAllProperties implementation to simply iterate and call SetupProperty + * 200 Fluent mock does not honor parent mock CallBase setting. + * 202 Mock.Protected().Expect() deprecated with no work-around + * 204 Allow default return values to be specified (per-mock) + * 205 Error calling SetupAllProperties for Mock<IDataErrorInfo> + * 206 Linq-to-Mocks Never Returns on Implicit Boolean Property + * 207 NullReferenceException thrown when using Mocks.CreateQuery with implicit boolean expression + * 208 Can't setup a mock for method that accept lambda expression as argument. + * 211 SetupAllProperties should return the Mock<T> instead of void. + * 223 When a method is defined to make the setup an asserts mock fails + * 226 Can't raise events on mocked Interop interfaces + * 229 CallBase is not working for virtual events + * 238 Moq fails to mock events defined in F# + * 239 Use Func instead of Predicate + * 250 4.0 Beta 2 regression - cannot mock MethodInfo when targetting .NET 4 + * 251 When a generic interface also implements a non-generic version, Verify does not work in some cases + * 254 Unable to create mock of EnvDTE.DTE + * 261 Can not use protected setter in public property + * 267 Generic argument as dependency for method Setup overrides all previous method setups for a given method + * 273 Attempting to create a mock thrown a Type Load exception. The message refers to an inaccessible interface. + * 276 .Net 3.5 no more supported + +Version 3.0 + +* Silverlight support! Finally integrated Jason's Silverlight contribution! Issue #73 +* Brand-new simplified event raising syntax (#130): mock.Raise(foo => foo.MyEvent += null, new MyArgs(...)); +* Support for custom event signatures (not compatible with EventHandler): mock.Raise(foo => foo.MyEvent += null, arg1, arg2, arg3); +* Substantially improved property setter behavior: mock.VerifySet(foo => foo.Value = "foo"); //(also available for SetupSet +* Renamed Expect* with Setup* +* Vastly simplified custom argument matchers: public int IsOdd() < return Match<int>.Create(v => i % 2 == 0); > +* Added support for verifying how many times a member was invoked: mock.Verify(foo => foo.Do(), Times.Never()); +* Added simple sample app named StoreSample +* Moved Stub functionality to the core API (SetupProperty and SetupAllProperties) +* Fixed sample ASP.NET MVC app to work with latest version +* Allow custom matchers to be created with a substantially simpler API +* Fixed issue #145 which prevented discrimination of setups by generic method argument types +* Fixed issue #141 which prevented ref arguments matching value types (i.e. a Guid) +* Implemented improvement #131: Add support for It.IsAny and custom argument matchers for SetupSet/VerifySet +* Implemented improvement #124 to render better error messages +* Applied patch from David Kirkland for improvement #125 to improve matching of enumerable parameters +* Implemented improvement #122 to provide custom errors for Verify +* Implemented improvement #121 to provide null as default value for Nullable<T> +* Fixed issue #112 which fixes passing a null argument to a mock constructor +* Implemented improvement #111 to better support params arguments +* Fixed bug #105 about improperly overwriting setups for property getter and setter +* Applied patch from Ihar.Bury for issue #99 related to protected expectations +* Fixed issue #97 on not being able to use SetupSet/VerifySet if property did not have a getter +* Better integration with Pex (http://research.microsoft.com/en-us/projects/Pex/) +* Various other minor fixes (#134, #135, #137, #138, #140, etc.) + + +Version 2.6 + +* Implemented Issue #55: We now provide a mock.DefaultValue = [DefaultValue.Empty | DefaultValue.Mock] which will provide the current behavior (default) or mocks for mockeable return types for loose mock invocations without expectations. +* Added support for stubbing properties from moq-contrib: now you can do mock.Stub(m => m.Value) and add stub behavior to the property. mock.StubAll() is also provided. This integrates with the DefaultValue behavior too, so you can stub entire hierarchies :). +* Added support for mocking methods with out and ref parameters (Issue #50) +* Applied patch contributed by slava for Issue #72: add support to limit numbor of calls on mocked method (we now have mock.Expect(...).AtMost(5)) +* Implemented Issue #94: Easier setter verification: Now we support ExpectSet(m = m.Value, "foo") and VerifySet(m = m.Value, 5) (Thanks ASP.NET MVC Team!) +* Implemented issue #96: Automatically chain mocks when setting expectations. It's now possible to specify expectations for an entire hierarchy of objects just starting from the root mock. THIS IS REALLY COOL!!! +* Fixed Issue #89: Expects() does not always return last expectation +* Implemented Issue 91: Expect a method/property to never be called (added Never() method to an expectation. Can be used on methods, property getters and setters) +* Fixed Issue 86: IsAny<T> should check if the value is actually of type T +* Fixed Issue 88: Cannot mock protected internal virtual methods using Moq.Protected +* Fixed Issue 90: Removing event handlers from mocked objects +* Updated demo and added one more test for the dynamic addition of interfaces + +Version 2.5 + +* Added support for mocking protected members +* Added new way of extending argument matchers which is now very straightforward +* Added support for mocking events +* Added support for firing events from expectations +* Removed usage of MBROs which caused inconsistencies in mocking features +* Added ExpectGet and ExpectSet to better support properties, and provide better intellisense. +* Added verification with expressions, which better supports Arrange-Act-Assert testing model (can do Verify(m => m.Do(...))) +* Added Throws<TException> +* Added mock.CallBase property to specify whether the virtual members base implementation should be called +* Added support for implementing and setting expectations and verifying additional interfaces in the mock, via the new mock.As<TInterface>() method (thanks Fernando Simonazzi!) +* Improved argument type matching for Is/IsAny (thanks Jeremy.Skinner!) + + +Version 2.0 + +* Refactored fluent API on mocks. This may cause some existing tests to fail, but the fix is trivial (just reorder the calls to Callback, Returns and Verifiable) +* Added support for retrieving a Mock<T> from a T instance created by a mock. +* Added support for retrieving the invocation arguments from a Callback or Returns. +* Implemented AtMostOnce() constraint +* Added support for creating MBROs with protected constructors +* Loose mocks now return default empty arrays and IEnumerables instead of nulls + + +Version 1.5.1 + +* Refactored MockFactory to make it simpler and more explicit to use with regards to verification. Thanks Garry Shutler for the feedback! + +Version 1.5 + +* Added MockFactory to allow easy construction of multiple mocks with the same behavior and verification + +Version 1.4 + +* Added support for passing constructor arguments for mocked classes. +* Improved code documentation + +Version 1.3 + + * Added support for overriding expectations set previously on a Mock. Now adding a second expectation for the same method/property call will override the existing one. This facilitates setting up default expectations in a fixture setup and overriding when necessary in a specific test. + * Added support for mock verification. Both Verify and VerifyAll are provided for more flexibility (the former only verifies methods marked Verifiable) + +Version 1.2 + +* Added support for MockBehavior mock constructor argument to affect the way the mocks expect or throw on calls. + +Version 1.1 + +* Merged branch for dynamic types. Now Moq is based on Castle DynamicProxy2 to support a wider range of mock targets. +* Added ILMerge so that Castle libraries are merged into Moq assembly (no need for external references and avoid conflicts) + +Version 1.0 + +* Initial release, initial documentation process in place, etc. + tdd mocking mocks unittesting agile + + \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/packages/Moq.4.1.1309.1617/lib/net35/Moq.dll Binary file src/packages/Moq.4.1.1309.1617/lib/net35/Moq.dll has changed diff -r 000000000000 -r 5bca2d201ad8 src/packages/Moq.4.1.1309.1617/lib/net35/Moq.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/packages/Moq.4.1.1309.1617/lib/net35/Moq.xml Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,6034 @@ + + + + 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. + + + + + Handle interception + + the current invocation context + shared data among the strategies during an interception + true if further interception has to be processed, otherwise false + + + + Covarient interface for Mock<T> such that casts between IMock<Employee> to IMock<Person> + are possible. Only covers the covariant members of Mock<T>. + + + + + Exposes the mocked object instance. + + + + + 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. + + + + + 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 + + + + Get an eventInfo for a given event name. Search type ancestors depth first if necessary. + Searches also in non public events. + + 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 + + + + 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]); + + + + + + Calls the real method of the object and returns its return value. + + The value calculated by the real method of the object. + + + + 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 + + + + + Calls original method + + + + + 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. + + + + + If this is a mock of a delegate, this property contains the method + on the autogenerated interface so that we can convert setup + verify + expressions on the delegate into expressions on the interface proxy. + + + + + Allows to check whether expression conversion to the + must be performed on the mock, without causing unnecessarily early initialization of + the mock instance, which breaks As{T}. + + + + + 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. + + + + + Calls the real property of the object and returns its return value. + + The value calculated by the real property of the object. + + + + 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. + + + + Provides additional methods on mocks. + + + Those methods are useful for Testeroids support. + + + + + Resets the calls previously made on the specified mock. + + The mock whose calls need to be reset. + + + + 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. 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, + 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. 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. + + 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 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. + + 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. + + + + 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. + + + + + Extracts, into a common form, information from a + around either a (for a normal method call) + or a (for a delegate invocation). + + + + + Tests if a type is a delegate type (subclasses ). + + + + + 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. + + + + + 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 of the given type, except null. + 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 any value that is present in the sequence specified. + Type of the argument to check.The sequence of possible values. + The following example shows how to expect a method call + with an integer argument with value from a list. + + var values = new List<int> { 1, 2, 3 }; + + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsIn(values))) + .Returns(false); + + + + + + Matches any value that is present in the sequence specified. + Type of the argument to check.The sequence of possible values. + The following example shows how to expect a method call + with an integer argument with a value of 1, 2, or 3. + + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsIn(1, 2, 3))) + .Returns(false); + + + + + + Matches any value that is not found in the sequence specified. + Type of the argument to check.The sequence of disallowed values. + The following example shows how to expect a method call + with an integer argument with value not found from a list. + + var values = new List<int> { 1, 2, 3 }; + + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsNotIn(values))) + .Returns(false); + + + + + + Matches any value that is not found in the sequence specified. + Type of the argument to check.The sequence of disallowed values. + The following example shows how to expect a method call + with an integer argument of any value except 1, 2, or 3. + + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsNotIn(1, 2, 3))) + .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. + + + + Indicates whether this exception is a verification fault raised by Verify() + + + + + 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 delegate mocks.. + + + + + 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. + + + + + Gets an autogenerated interface with a method on it that matches the signature of the specified + . + + + Such an interface can then be mocked, and a delegate pointed at the method on the mocked instance. + This is how we support delegate mocking. The factory caches such interfaces and reuses them + for repeated requests for the same delegate type. + + The delegate type for which an interface is required. + The method on the autogenerated interface. + + + + + + + + + + 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 -r 000000000000 -r 5bca2d201ad8 src/packages/Moq.4.1.1309.1617/lib/net40/Moq.dll Binary file src/packages/Moq.4.1.1309.1617/lib/net40/Moq.dll has changed diff -r 000000000000 -r 5bca2d201ad8 src/packages/Moq.4.1.1309.1617/lib/net40/Moq.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/packages/Moq.4.1.1309.1617/lib/net40/Moq.xml Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,5386 @@ + + + + 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. + + + + + Handle interception + + the current invocation context + shared data among the strategies during an interception + true if further interception has to be processed, otherwise false + + + + Covarient interface for Mock<T> such that casts between IMock<Employee> to IMock<Person> + are possible. Only covers the covariant members of Mock<T>. + + + + + Exposes the mocked object instance. + + + + + 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. + + + + + 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 + + + + Get an eventInfo for a given event name. Search type ancestors depth first if necessary. + Searches also in non public events. + + 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 + + + + 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]); + + + + + + Calls the real method of the object and returns its return value. + + The value calculated by the real method of the object. + + + + 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 + + + + + Calls original method + + + + + 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. + + + + + If this is a mock of a delegate, this property contains the method + on the autogenerated interface so that we can convert setup + verify + expressions on the delegate into expressions on the interface proxy. + + + + + Allows to check whether expression conversion to the + must be performed on the mock, without causing unnecessarily early initialization of + the mock instance, which breaks As{T}. + + + + + 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. + + + + + Calls the real property of the object and returns its return value. + + The value calculated by the real property of the object. + + + + Implements the fluent API. + + + + + Provides additional methods on mocks. + + + Those methods are useful for Testeroids support. + + + + + Resets the calls previously made on the specified mock. + + The mock whose calls need to be reset. + + + + 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. 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, + 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. 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. + + 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 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. + + 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. + + + + 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. + + + + + Extracts, into a common form, information from a + around either a (for a normal method call) + or a (for a delegate invocation). + + + + + Tests if a type is a delegate type (subclasses ). + + + + + 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. + + + + + 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 of the given type, except null. + 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 any value that is present in the sequence specified. + Type of the argument to check.The sequence of possible values. + The following example shows how to expect a method call + with an integer argument with value from a list. + + var values = new List<int> { 1, 2, 3 }; + + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsIn(values))) + .Returns(false); + + + + + + Matches any value that is present in the sequence specified. + Type of the argument to check.The sequence of possible values. + The following example shows how to expect a method call + with an integer argument with a value of 1, 2, or 3. + + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsIn(1, 2, 3))) + .Returns(false); + + + + + + Matches any value that is not found in the sequence specified. + Type of the argument to check.The sequence of disallowed values. + The following example shows how to expect a method call + with an integer argument with value not found from a list. + + var values = new List<int> { 1, 2, 3 }; + + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsNotIn(values))) + .Returns(false); + + + + + + Matches any value that is not found in the sequence specified. + Type of the argument to check.The sequence of disallowed values. + The following example shows how to expect a method call + with an integer argument of any value except 1, 2, or 3. + + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsNotIn(1, 2, 3))) + .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. + + + + Indicates whether this exception is a verification fault raised by Verify() + + + + + 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 delegate mocks.. + + + + + 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. + + + + + Gets an autogenerated interface with a method on it that matches the signature of the specified + . + + + Such an interface can then be mocked, and a delegate pointed at the method on the mocked instance. + This is how we support delegate mocking. The factory caches such interfaces and reuses them + for repeated requests for the same delegate type. + + The delegate type for which an interface is required. + The method on the autogenerated interface. + + + + + + + + + + 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 -r 000000000000 -r 5bca2d201ad8 src/packages/Moq.4.1.1309.1617/lib/sl4/Moq.Silverlight.dll Binary file src/packages/Moq.4.1.1309.1617/lib/sl4/Moq.Silverlight.dll has changed diff -r 000000000000 -r 5bca2d201ad8 src/packages/Moq.4.1.1309.1617/lib/sl4/Moq.Silverlight.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/packages/Moq.4.1.1309.1617/lib/sl4/Moq.Silverlight.xml Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,5353 @@ + + + + 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. + + + + + If this is a mock of a delegate, this property contains the method + on the autogenerated interface so that we can convert setup + verify + expressions on the delegate into expressions on the interface proxy. + + + + + Allows to check whether expression conversion to the + must be performed on the mock, without causing unnecessarily early initialization of + the mock instance, which breaks As{T}. + + + + + 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. + + + + + Covarient interface for Mock<T> such that casts between IMock<Employee> to IMock<Person> + are possible. Only covers the covariant members of Mock<T>. + + + + + Exposes the mocked object instance. + + + + + 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. + + + + + 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. 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, + 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. 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. + + 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 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. + + 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. + + + + 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. + + + + + Extracts, into a common form, information from a + around either a (for a normal method call) + or a (for a delegate invocation). + + + + + The intention of is to create a more readable + string representation for the failure message. + + + + + Tests if a type is a delegate type (subclasses ). + + + + + 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. + + + + Handle interception + + the current invocation context + shared data among the strategies during an interception + true if further interception has to be processed, otherwise false + + + + 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 + + + + Get an eventInfo for a given event name. Search type ancestors depth first if necessary. + Searches also in non public events. + + 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 of the given type, except null. + 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 any value that is present in the sequence specified. + Type of the argument to check.The sequence of possible values. + The following example shows how to expect a method call + with an integer argument with value from a list. + + var values = new List<int> { 1, 2, 3 }; + + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsIn(values))) + .Returns(false); + + + + + + Matches any value that is present in the sequence specified. + Type of the argument to check.The sequence of possible values. + The following example shows how to expect a method call + with an integer argument with a value of 1, 2, or 3. + + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsIn(1, 2, 3))) + .Returns(false); + + + + + + Matches any value that is not found in the sequence specified. + Type of the argument to check.The sequence of disallowed values. + The following example shows how to expect a method call + with an integer argument with value not found from a list. + + var values = new List<int> { 1, 2, 3 }; + + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsNotIn(values))) + .Returns(false); + + + + + + Matches any value that is not found in the sequence specified. + Type of the argument to check.The sequence of disallowed values. + The following example shows how to expect a method call + with an integer argument of any value except 1, 2, or 3. + + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsNotIn(1, 2, 3))) + .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]); + + + + + + Calls the real method of the object and returns its return value. + + The value calculated by the real method of the object. + + + + 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. + + + + + Calls the real property of the object and returns its return value. + + The value calculated by the real property of the object. + + + + 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 + + + + + Calls original method + + + + + 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. + + + + + + Indicates whether this exception is a verification fault raised by Verify() + + + + + 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 delegate mocks.. + + + + + 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}. + + + + + Gets an autogenerated interface with a method on it that matches the signature of the specified + . + + + Such an interface can then be mocked, and a delegate pointed at the method on the mocked instance. + This is how we support delegate mocking. The factory caches such interfaces and reuses them + for repeated requests for the same delegate type. + + The delegate type for which an interface is required. + The method on the autogenerated interface. + + + + + + + + + + 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 -r 000000000000 -r 5bca2d201ad8 src/packages/NUnit.2.6.3/NUnit.2.6.3.nupkg Binary file src/packages/NUnit.2.6.3/NUnit.2.6.3.nupkg has changed diff -r 000000000000 -r 5bca2d201ad8 src/packages/NUnit.2.6.3/NUnit.2.6.3.nuspec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/packages/NUnit.2.6.3/NUnit.2.6.3.nuspec Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,27 @@ + + + + NUnit + 2.6.3 + NUnit + Charlie Poole + Charlie Poole + http://nunit.org/nuget/license.html + http://nunit.org/ + http://nunit.org/nuget/nunit_32x32.png + false + NUnit features a fluent assert syntax, parameterized, generic and theory tests and is user-extensible. A number of runners, both from the NUnit project and by third parties, are able to execute NUnit tests. + +Version 2.6 is the seventh major release of this well-known and well-tested programming tool. + +This package includes only the framework assembly. You will need to install the NUnit.Runners package unless you are using a third-party runner. + NUnit is a unit-testing framework for all .Net languages with a strong TDD focus. + Version 2.6 is the seventh major release of NUnit. + +Unlike earlier versions, this package includes only the framework assembly. You will need to install the NUnit.Runners package unless you are using a third-party runner. + +The nunit.mocks assembly is now provided by the NUnit.Mocks package. The pnunit.framework assembly is provided by the pNUnit package. + en-US + nunit test testing tdd framework fluent assert theory plugin addin + + \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/packages/NUnit.2.6.3/lib/nunit.framework.dll Binary file src/packages/NUnit.2.6.3/lib/nunit.framework.dll has changed diff -r 000000000000 -r 5bca2d201ad8 src/packages/NUnit.2.6.3/lib/nunit.framework.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/packages/NUnit.2.6.3/lib/nunit.framework.xml Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,10960 @@ + + + + nunit.framework + + + + + The different targets a test action attribute can be applied to + + + + + Default target, which is determined by where the action attribute is attached + + + + + Target a individual test case + + + + + Target a suite of test cases + + + + + 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. + + + + + + + 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. + + The actual value to test + A Constraint to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The actual value to test + A Constraint to be applied + 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. + + The actual value to test + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that 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 + + + + 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 + + + + 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 + + + + 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. + + The actual value to test + A Constraint to be applied + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The actual value to test + A Constraint to be applied + 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. + + The actual value to test + A Constraint to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A ThrowsConstraint used in the test + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + Used as a synonym for That in rare cases where a private setter + causes a Visual Basic compilation error. + + The actual value to test + A Constraint to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + Used as a synonym for That in rare cases where a private setter + causes a Visual Basic compilation error. + + The actual value to test + A Constraint to be applied + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + Used as a synonym for That in rare cases where a private setter + causes a Visual Basic compilation error. + + + This method is provided for use by VB developers needing to test + the value of properties with private setters. + + The actual value to test + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws a particular exception when called. + + A constraint to be satisfied by the exception + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws a particular exception when called. + + A constraint to be satisfied by the exception + A TestDelegate + 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 TestDelegate + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestDelegate + The message that will be displayed on failure + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestDelegate + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestDelegate + The message that will be displayed on failure + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestDelegate + + + + Verifies that a delegate throws an exception when called + and returns it. + + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws an exception when called + and returns it. + + A TestDelegate + 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 TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate does not throw an exception. + + A TestDelegate + The message that will be displayed on failure + + + + Verifies that a delegate does not throw an exception. + + A TestDelegate + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display 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 two ints 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 ints 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 ints are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two longs 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 longs 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 longs are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two unsigned ints 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 unsigned ints 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 unsigned ints are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two unsigned longs 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 unsigned longs 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 unsigned longs are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two decimals 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 decimals 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 decimals 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 ints 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 ints 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 ints are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two longs 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 longs 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 longs are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two unsigned ints 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 unsigned ints 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 unsigned ints are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two unsigned longs 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 unsigned longs 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 unsigned longs are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two decimals 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 decimals 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 decimals are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two floats 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 floats 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 floats are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two doubles 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 doubles 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 doubles 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 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 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 + + + + 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 + + + + 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. + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding only if a specified number of them succeed. + + + + + Returns a new PropertyConstraintExpression, which will either + test for the existence of the named property on the object + being tested or apply any following constraint to that property. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a constraint that tests two items for equality + + + + + Returns a constraint that tests that two references are the same object + + + + + Returns a constraint that tests whether the + actual value is greater than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a collection containing the same elements as the + collection supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a subset of the collection supplied as an argument. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new ContainsConstraint. This constraint + will, in turn, make use of the appropriate second-level + constraint, depending on the type of the actual argument. + This overload is only used if the item sought is a string, + since any other type implies that we are looking for a + collection member. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that fails if the actual + value matches the pattern supplied as an argument. + + + + + Returns a constraint that tests whether the path provided + is the same as an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the actual value falls + within a specified range. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if at least one of them succeeds. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them fail. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Length property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Count property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Message property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the InnerException property of the object being tested. + + + + + Returns a constraint that tests for null + + + + + Returns a constraint that tests for True + + + + + Returns a constraint that tests for False + + + + + Returns a constraint that tests for a positive value + + + + + Returns a constraint that tests for a negative value + + + + + Returns a constraint that tests for NaN + + + + + Returns a constraint that tests for empty + + + + + Returns a constraint that tests whether a collection + contains all unique items. + + + + + Returns a constraint that tests whether an object graph is serializable in binary format. + + + + + Returns a constraint that tests whether an object graph is serializable in xml format. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. Works + identically to Assert.That. + + The actual value to test + A Constraint to be applied + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. Works + identically to Assert.That. + + The actual value to test + A Constraint to be applied + The message to be displayed in case of failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. Works + identically to Assert.That. + + The actual value to test + A Constraint to be applied + The message to be displayed in case of failure + Arguments to use 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 + + + + 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. + + The actual value to test + A Constraint to be applied + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + The actual value to test + A Constraint to be applied + 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. + + The actual value to test + A Constraint to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A 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 + + + + 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 + + + + 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 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 + + + + Waits for pending asynchronous operations to complete, if appropriate, + and returns a proper result of the invocation by unwrapping task results + + The raw result of the method invocation + The unwrapped result, if necessary + + + + 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 + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + 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 + + + + + Class used to guard against unexpected argument values + by throwing an appropriate exception. + + + + + Throws an exception if an argument is null + + The value to be tested + The name of the argument + + + + Throws an exception if a string argument is null or empty + + The value to be tested + The name of the argument + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding only if a specified number of them succeed. + + + + + Returns a new PropertyConstraintExpression, which will either + test for the existence of the named property on the object + being tested or apply any following constraint to that property. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if at least one of them succeeds. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them fail. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Length property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Count property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Message property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the InnerException property of the object being tested. + + + + + Interface implemented by a user fixture in order to + validate any expected exceptions. It is only called + for test methods marked with the ExpectedException + attribute. + + + + + Method to handle an expected exception + + The exception to be handled + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a constraint that tests two items for equality + + + + + Returns a constraint that tests that two references are the same object + + + + + Returns a constraint that tests whether the + actual value is greater than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a collection containing the same elements as the + collection supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a subset of the collection supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that tests whether the path provided + is the same as an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the actual value falls + within a specified range. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a constraint that tests for null + + + + + Returns a constraint that tests for True + + + + + Returns a constraint that tests for False + + + + + Returns a constraint that tests for a positive value + + + + + Returns a constraint that tests for a negative value + + + + + Returns a constraint that tests for NaN + + + + + Returns a constraint that tests for empty + + + + + Returns a constraint that tests whether a collection + contains all unique items. + + + + + Returns a constraint that tests whether an object graph is serializable in binary format. + + + + + Returns a constraint that tests whether an object graph is serializable in xml format. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + The ITestCaseData interface is implemented by a class + that is able to return complete testcases for use by + a parameterized test method. + + NOTE: This interface is used in both the framework + and the core, even though that results in two different + types. However, sharing the source code guarantees that + the various implementations will be compatible and that + the core is able to reflect successfully over the + framework implementations of ITestCaseData. + + + + + Gets the argument list to be provided to the test + + + + + Gets the expected result + + + + + Indicates whether a result has been specified. + This is necessary because the result may be + null, so it's value cannot be checked. + + + + + Gets the expected exception Type + + + + + Gets the FullName of the expected exception + + + + + Gets the name to be used for the test + + + + + Gets the description of the test + + + + + Gets a value indicating whether this is ignored. + + true if ignored; otherwise, false. + + + + Gets a value indicating whether this is explicit. + + true if explicit; otherwise, false. + + + + Gets the ignore reason. + + The ignore reason. + + + + 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 attribute under .NET 1.x + + + + + Basic Asserts on strings. + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + + + + Asserts that a string is not found within another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + + + + Asserts that a string starts with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string starts with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string starts with another string. + + The expected string + The string to be examined + + + + Asserts that a string does not start with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string does not start with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string does not start with another string. + + The expected string + The string to be examined + + + + Asserts that a string ends with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string ends with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string ends with another string. + + The expected string + The string to be examined + + + + Asserts that a string does not end with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string does not end with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string does not end with another string. + + The expected string + The string to be examined + + + + Asserts that two strings are equal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that two strings are equal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + + + + Asserts that two strings are equal, without regard to case. + + The expected string + The actual string + + + + Asserts that two strings are not equal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that two strings are Notequal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + + + + Asserts that two strings are not equal, without regard to case. + + The expected string + The actual string + + + + Asserts that a string matches an expected regular expression pattern. + + The regex pattern to be matched + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string matches an expected regular expression pattern. + + The regex pattern to be matched + The actual string + The message to display in case of failure + + + + Asserts that a string matches an expected regular expression pattern. + + The regex pattern to be matched + The actual string + + + + Asserts that a string does not match an expected regular expression pattern. + + The regex pattern to be used + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string does not match an expected regular expression pattern. + + The regex pattern to be used + The actual string + The message to display in case of failure + + + + Asserts that a string does not match an expected regular expression pattern. + + The regex pattern to be used + The actual string + + + + The TestCaseData class represents a set of arguments + and other parameter info to be used for a parameterized + test case. It provides a number of instance modifiers + for use in initializing the test case. + + Note: Instance modifiers are getters that return + the same instance after modifying it's state. + + + + + The argument list to be provided to the test + + + + + The expected result to be returned + + + + + Set to true if this has an expected result + + + + + The expected exception Type + + + + + The FullName of the expected exception + + + + + The name to be used for the test + + + + + The description of the test + + + + + A dictionary of properties, used to add information + to tests without requiring the class to change. + + + + + If true, indicates that the test case is to be ignored + + + + + If true, indicates that the test case is marked explicit + + + + + The reason for ignoring a test case + + + + + Initializes a new instance of the class. + + The arguments. + + + + Initializes a new instance of the class. + + The argument. + + + + Initializes a new instance of the class. + + The first argument. + The second argument. + + + + Initializes a new instance of the class. + + The first argument. + The second argument. + The third argument. + + + + Sets the expected result for the test + + The expected result + A modified TestCaseData + + + + Sets the expected exception type for the test + + Type of the expected exception. + The modified TestCaseData instance + + + + Sets the expected exception type for the test + + FullName of the expected exception. + The modified TestCaseData instance + + + + Sets the name of the test case + + The modified TestCaseData instance + + + + Sets the description for the test case + being constructed. + + The description. + The modified TestCaseData instance. + + + + Applies a category to the test + + + + + + + Applies a named property to the test + + + + + + + + Applies a named property to the test + + + + + + + + Applies a named property to the test + + + + + + + + Ignores this TestCase. + + + + + + Ignores this TestCase, specifying the reason. + + The reason. + + + + + Marks this TestCase as Explicit + + + + + + Marks this TestCase as Explicit, specifying the reason. + + The reason. + + + + + Gets the argument list to be provided to the test + + + + + Gets the expected result + + + + + Returns true if the result has been set + + + + + Gets the expected exception Type + + + + + Gets the FullName of the expected exception + + + + + Gets the name to be used for the test + + + + + Gets the description of the test + + + + + Gets a value indicating whether this is ignored. + + true if ignored; otherwise, false. + + + + Gets a value indicating whether this is explicit. + + true if explicit; otherwise, false. + + + + Gets the ignore reason. + + The ignore reason. + + + + Gets a list of categories associated with this test. + + + + + Gets the property dictionary for this test + + + + + Provide the context information of the current test + + + + + Constructs a TestContext using the provided context dictionary + + A context dictionary + + + + Get the current test context. This is created + as needed. The user may save the context for + use within a test, but it should not be used + outside the test for which it is created. + + + + + Gets a TestAdapter representing the currently executing test in this context. + + + + + Gets a ResultAdapter representing the current result for the test + executing in this context. + + + + + Gets the directory containing the current test assembly. + + + + + Gets the directory to be used for outputing files created + by this test run. + + + + + TestAdapter adapts a Test for consumption by + the user test code. + + + + + Constructs a TestAdapter for this context + + The context dictionary + + + + The name of the test. + + + + + The FullName of the test + + + + + The properties of the test. + + + + + ResultAdapter adapts a TestResult for consumption by + the user test code. + + + + + Construct a ResultAdapter for a context + + The context holding the result + + + + The TestState of current test. This maps to the ResultState + used in nunit.core and is subject to change in the future. + + + + + The TestStatus of current test. This enum will be used + in future versions of NUnit and so is to be preferred + to the TestState value. + + + + + Provides details about a test + + + + + Creates an instance of TestDetails + + The fixture that the test is a member of, if available. + The method that implements the test, if available. + The full name of the test. + A string representing the type of test, e.g. "Test Case". + Indicates if the test represents a suite of tests. + + + + The fixture that the test is a member of, if available. + + + + + The method that implements the test, if available. + + + + + The full name of the test. + + + + + A string representing the type of test, e.g. "Test Case". + + + + + Indicates if the test represents a suite of tests. + + + + + The ResultState enum indicates the result of running a test + + + + + The result is inconclusive + + + + + The test was not runnable. + + + + + The test has been skipped. + + + + + The test has been ignored. + + + + + The test succeeded + + + + + The test failed + + + + + The test encountered an unexpected exception + + + + + The test was cancelled by the user + + + + + The TestStatus enum indicates the result of running a test + + + + + The test was inconclusive + + + + + The test has skipped + + + + + The test succeeded + + + + + The test failed + + + + + Helper class with static methods used to supply constraints + that operate on strings. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that fails if the actual + value matches the pattern supplied as an argument. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + TextMessageWriter writes constraint descriptions and messages + in displayable form as a text stream. It tailors the display + of individual message components to form the standard message + format of NUnit assertion failure messages. + + + + + 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 + + + + + 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 + + + + + Attribute used to apply a category to a test + + + + + The name of the category + + + + + Construct attribute for a given category based on + a name. The name may not contain the characters ',', + '+', '-' or '!'. However, this is not checked in the + constructor since it would cause an error to arise at + as the test was loaded without giving a clear indication + of where the problem is located. The error is handled + in NUnitFramework.cs by marking the test as not + runnable. + + The name of the category + + + + Protected constructor uses the Type name as the name + of the category. + + + + + The name of the category + + + + + Used to mark a field for use as a datapoint when executing a theory + within the same fixture that requires an argument of the field's Type. + + + + + Used to mark an array as containing a set of datapoints to be used + executing a theory within the same fixture that requires an argument + of the Type of the array elements. + + + + + Attribute used to provide descriptive text about a + test case or fixture. + + + + + Construct the attribute + + Text describing the test + + + + Gets the test description + + + + + Enumeration indicating how the expected message parameter is to be used + + + + Expect an exact match + + + Expect a message containing the parameter string + + + Match the regular expression provided as a parameter + + + Expect a message that starts with the parameter string + + + + ExpectedExceptionAttribute + + + + + + Constructor for a non-specific exception + + + + + Constructor for a given type of exception + + The type of the expected exception + + + + Constructor for a given exception name + + The full name of the expected exception + + + + Gets or sets the expected exception type + + + + + Gets or sets the full Type name of the expected exception + + + + + Gets or sets the expected message text + + + + + Gets or sets the user message displayed in case of failure + + + + + Gets or sets the type of match to be performed on the expected message + + + + + Gets the name of a method to be used as an exception handler + + + + + ExplicitAttribute marks a test or test fixture so that it will + only be run if explicitly executed from the gui or command line + or if it is included by use of a filter. The test will not be + run simply because an enclosing suite is run. + + + + + Default constructor + + + + + Constructor with a reason + + The reason test is marked explicit + + + + The reason test is marked explicit + + + + + Attribute used to mark a test that is to be ignored. + Ignored tests result in a warning message when the + tests are run. + + + + + Constructs the attribute without giving a reason + for ignoring the test. + + + + + Constructs the attribute giving a reason for ignoring the test + + The reason for ignoring the test + + + + The reason for ignoring a test + + + + + Abstract base for Attributes that are used to include tests + in the test run based on environmental settings. + + + + + Constructor with no included items specified, for use + with named property syntax. + + + + + Constructor taking one or more included items + + Comma-delimited list of included items + + + + Name of the item that is needed in order for + a test to run. Multiple itemss may be given, + separated by a comma. + + + + + Name of the item to be excluded. Multiple items + may be given, separated by a comma. + + + + + The reason for including or excluding the test + + + + + PlatformAttribute is used to mark a test fixture or an + individual method as applying to a particular platform only. + + + + + Constructor with no platforms specified, for use + with named property syntax. + + + + + Constructor taking one or more platforms + + Comma-deliminted list of platforms + + + + CultureAttribute is used to mark a test fixture or an + individual method as applying to a particular Culture only. + + + + + Constructor with no cultures specified, for use + with named property syntax. + + + + + Constructor taking one or more cultures + + Comma-deliminted list of cultures + + + + Marks a test to use a combinatorial join of any argument data + provided. NUnit will create a test case for every combination of + the arguments provided. This can result in a large number of test + cases and so should be used judiciously. This is the default join + type, so the attribute need not be used except as documentation. + + + + + PropertyAttribute is used to attach information to a test as a name/value pair.. + + + + + Construct a PropertyAttribute with a name and string value + + The name of the property + The property value + + + + Construct a PropertyAttribute with a name and int value + + The name of the property + The property value + + + + Construct a PropertyAttribute with a name and double value + + The name of the property + The property value + + + + Constructor for derived classes that set the + property dictionary directly. + + + + + Constructor for use by derived classes that use the + name of the type as the property name. Derived classes + must ensure that the Type of the property value is + a standard type supported by the BCL. Any custom + types will cause a serialization Exception when + in the client. + + + + + Gets the property dictionary for this attribute + + + + + Default constructor + + + + + Marks a test to use pairwise join of any argument data provided. + NUnit will attempt too excercise every pair of argument values at + least once, using as small a number of test cases as it can. With + only two arguments, this is the same as a combinatorial join. + + + + + Default constructor + + + + + Marks a test to use a sequential join of any argument data + provided. NUnit will use arguements for each parameter in + sequence, generating test cases up to the largest number + of argument values provided and using null for any arguments + for which it runs out of values. Normally, this should be + used with the same number of arguments for each parameter. + + + + + Default constructor + + + + + Summary description for MaxTimeAttribute. + + + + + Construct a MaxTimeAttribute, given a time in milliseconds. + + The maximum elapsed time in milliseconds + + + + RandomAttribute is used to supply a set of random values + to a single parameter of a parameterized test. + + + + + ValuesAttribute is used to provide literal arguments for + an individual parameter of a test. + + + + + Abstract base class for attributes that apply to parameters + and supply data for the parameter. + + + + + Gets the data to be provided to the specified parameter + + + + + The collection of data to be returned. Must + be set by any derived attribute classes. + We use an object[] so that the individual + elements may have their type changed in GetData + if necessary. + + + + + Construct with one argument + + + + + + Construct with two arguments + + + + + + + Construct with three arguments + + + + + + + + Construct with an array of arguments + + + + + + Get the collection of values to be used as arguments + + + + + Construct a set of doubles from 0.0 to 1.0, + specifying only the count. + + + + + + Construct a set of doubles from min to max + + + + + + + + Construct a set of ints from min to max + + + + + + + + Get the collection of values to be used as arguments + + + + + RangeAttribute is used to supply a range of values to an + individual parameter of a parameterized test. + + + + + Construct a range of ints using default step of 1 + + + + + + + Construct a range of ints specifying the step size + + + + + + + + Construct a range of longs + + + + + + + + Construct a range of doubles + + + + + + + + Construct a range of floats + + + + + + + + RepeatAttribute may be applied to test case in order + to run it multiple times. + + + + + Construct a RepeatAttribute + + The number of times to run the test + + + + RequiredAddinAttribute may be used to indicate the names of any addins + that must be present in order to run some or all of the tests in an + assembly. If the addin is not loaded, the entire assembly is marked + as NotRunnable. + + + + + Initializes a new instance of the class. + + The required addin. + + + + Gets the name of required addin. + + The required addin name. + + + + Summary description for SetCultureAttribute. + + + + + Construct given the name of a culture + + + + + + Summary description for SetUICultureAttribute. + + + + + Construct given the name of a culture + + + + + + SetUpAttribute is used in a TestFixture to identify a method + that is called immediately before each test is run. It is + also used in a SetUpFixture to identify the method that is + called once, before any of the subordinate tests are run. + + + + + Attribute used to mark a class that contains one-time SetUp + and/or TearDown methods that apply to all the tests in a + namespace or an assembly. + + + + + Attribute used to mark a static (shared in VB) property + that returns a list of tests. + + + + + Attribute used in a TestFixture to identify a method that is + called immediately after each test is run. It is also used + in a SetUpFixture to identify the method that is called once, + after all subordinate tests have run. In either case, the method + is guaranteed to be called, even if an exception is thrown. + + + + + Provide actions to execute before and after tests. + + + + + When implemented by an attribute, this interface implemented to provide actions to execute before and after tests. + + + + + Executed before each test is run + + Provides details about the test that is going to be run. + + + + Executed after each test is run + + Provides details about the test that has just been run. + + + + Provides the target for the action attribute + + The target for the action attribute + + + + Adding this attribute to a method within a + class makes the method callable from the NUnit test runner. There is a property + called Description which is optional which you can provide a more detailed test + description. This class cannot be inherited. + + + + [TestFixture] + public class Fixture + { + [Test] + public void MethodToTest() + {} + + [Test(Description = "more detailed description")] + publc void TestDescriptionMethod() + {} + } + + + + + + Descriptive text for this test + + + + + TestCaseAttribute is used to mark parameterized test cases + and provide them with their arguments. + + + + + Construct a TestCaseAttribute with a list of arguments. + This constructor is not CLS-Compliant + + + + + + Construct a TestCaseAttribute with a single argument + + + + + + Construct a TestCaseAttribute with a two arguments + + + + + + + Construct a TestCaseAttribute with a three arguments + + + + + + + + Gets the list of arguments to a test case + + + + + Gets or sets the expected result. Use + ExpectedResult by preference. + + The result. + + + + Gets or sets the expected result. + + The result. + + + + Gets a flag indicating whether an expected + result has been set. + + + + + Gets a list of categories associated with this test; + + + + + Gets or sets the category associated with this test. + May be a single category or a comma-separated list. + + + + + Gets or sets the expected exception. + + The expected exception. + + + + Gets or sets the name the expected exception. + + The expected name of the exception. + + + + Gets or sets the expected message of the expected exception + + The expected message of the exception. + + + + Gets or sets the type of match to be performed on the expected message + + + + + Gets or sets the description. + + The description. + + + + Gets or sets the name of the test. + + The name of the test. + + + + Gets or sets the ignored status of the test + + + + + Gets or sets the ignored status of the test + + + + + Gets or sets the explicit status of the test + + + + + Gets or sets the reason for not running the test + + + + + Gets or sets the reason for not running the test. + Set has the side effect of marking the test as ignored. + + The ignore reason. + + + + FactoryAttribute indicates the source to be used to + provide test cases for a test method. + + + + + Construct with the name of the data source, which must + be a property, field or method of the test class itself. + + An array of the names of the factories that will provide data + + + + Construct with a Type, which must implement IEnumerable + + The Type that will provide data + + + + Construct with a Type and name. + that don't support params arrays. + + The Type that will provide data + The name of the method, property or field that will provide data + + + + The name of a the method, property or fiend to be used as a source + + + + + A Type to be used as a source + + + + + Gets or sets the category associated with this test. + May be a single category or a comma-separated list. + + + + + [TestFixture] + public class ExampleClass + {} + + + + + Default constructor + + + + + Construct with a object[] representing a set of arguments. + In .NET 2.0, the arguments may later be separated into + type arguments and constructor arguments. + + + + + + Descriptive text for this fixture + + + + + Gets and sets the category for this fixture. + May be a comma-separated list of categories. + + + + + Gets a list of categories for this fixture + + + + + The arguments originally provided to the attribute + + + + + Gets or sets a value indicating whether this should be ignored. + + true if ignore; otherwise, false. + + + + Gets or sets the ignore reason. May set Ignored as a side effect. + + The ignore reason. + + + + Get or set the type arguments. If not set + explicitly, any leading arguments that are + Types are taken as type arguments. + + + + + Attribute used to identify a method that is + called before any tests in a fixture are run. + + + + + Attribute used to identify a method that is called after + all the tests in a fixture have run. The method is + guaranteed to be called, even if an exception is thrown. + + + + + Adding this attribute to a method within a + class makes the method callable from the NUnit test runner. There is a property + called Description which is optional which you can provide a more detailed test + description. This class cannot be inherited. + + + + [TestFixture] + public class Fixture + { + [Test] + public void MethodToTest() + {} + + [Test(Description = "more detailed description")] + publc void TestDescriptionMethod() + {} + } + + + + + + Used on a method, marks the test with a timeout value in milliseconds. + The test will be run in a separate thread and is cancelled if the timeout + is exceeded. Used on a method or assembly, sets the default timeout + for all contained test methods. + + + + + Construct a TimeoutAttribute given a time in milliseconds + + The timeout value in milliseconds + + + + Marks a test that must run in the STA, causing it + to run in a separate thread if necessary. + + On methods, you may also use STAThreadAttribute + to serve the same purpose. + + + + + Construct a RequiresSTAAttribute + + + + + Marks a test that must run in the MTA, causing it + to run in a separate thread if necessary. + + On methods, you may also use MTAThreadAttribute + to serve the same purpose. + + + + + Construct a RequiresMTAAttribute + + + + + Marks a test that must run on a separate thread. + + + + + Construct a RequiresThreadAttribute + + + + + Construct a RequiresThreadAttribute, specifying the apartment + + + + + ValueSourceAttribute indicates the source to be used to + provide data for one parameter of a test method. + + + + + Construct with the name of the factory - for use with languages + that don't support params arrays. + + The name of the data source to be used + + + + Construct with a Type and name - for use with languages + that don't support params arrays. + + The Type that will provide data + The name of the method, property or field that will provide data + + + + The name of a the method, property or fiend to be used as a source + + + + + A Type to be used as a source + + + + + AllItemsConstraint applies another constraint to each + item in a collection, succeeding if they all succeed. + + + + + Abstract base class used for prefixes + + + + + 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 + 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. + + + + + The base constraint + + + + + Construct given a base constraint + + + + + + 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 + + + + + + AndConstraint succeeds only if both members succeed. + + + + + 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 + + + + 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 + + + + AssignableFromConstraint is used to test that an object + can be assigned from a given Type. + + + + + 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 + + + + 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 + + + + AttributeConstraint tests that a specified attribute is present + on a Type or other provider and that the value of the attribute + satisfies some other constraint. + + + + + Constructs an AttributeConstraint for a specified 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. + + + + + AttributeExistsConstraint tests for the presence of a + specified attribute on a Type. + + + + + 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 + + + + + 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 + + + + 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 + + + + + CollectionConstraint is the abstract base class for + constraints that operate on collections. + + + + + Construct an empty CollectionConstraint + + + + + Construct a CollectionConstraint + + + + + + Determines whether the specified enumerable is empty. + + The enumerable. + + true if the specified enumerable is empty; otherwise, false. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Protected method to be implemented by derived classes + + + + + + + CollectionContainsConstraint is used to test whether a collection + contains an expected object as a member. + + + + + 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 EqualityAdapter. + NOTE: For internal use only. + + The EqualityAdapter 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. + + + + 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. + + + + + 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 + + + + + + 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 + + + + + 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 + + + + + + CollectionTally counts (tallies) the number of + occurences of each object in one or more enumerations. + + + + + Construct a CollectionTally object from a comparer and a collection + + + + + Try to remove an object from the tally + + The object to remove + True if successful, false if the object was not found + + + + Try to remove a set of objects from the tally + + The objects to remove + True if successful, false if any object was not found + + + + The number of objects remaining in the tally + + + + + ComparisonAdapter class centralizes all comparisons of + values in NUnit, adapting to the use of any provided + IComparer, IComparer<T> or Comparison<T> + + + + + Returns a ComparisonAdapter that wraps an IComparer + + + + + Returns a ComparisonAdapter that wraps an IComparer<T> + + + + + Returns a ComparisonAdapter that wraps a Comparison<T> + + + + + Compares two objects + + + + + Gets the default ComparisonAdapter, which wraps an + NUnitComparer object. + + + + + Construct a ComparisonAdapter for an IComparer + + + + + Compares two objects + + + + + + + + Construct a default ComparisonAdapter + + + + + ComparisonAdapter<T> extends ComparisonAdapter and + allows use of an IComparer<T> or Comparison<T> + to actually perform the comparison. + + + + + Construct a ComparisonAdapter for an IComparer<T> + + + + + Compare a Type T to an object + + + + + Construct a ComparisonAdapter for a Comparison<T> + + + + + Compare a Type T to an object + + + + + Abstract base class for constraints that compare values to + determine if one is greater than, equal to or less than + the other. This class supplies the Using modifiers. + + + + + ComparisonAdapter to be used in making the comparison + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Modifies the constraint to use an IComparer and returns self + + + + + Modifies the constraint to use an IComparer<T> and returns self + + + + + Modifies the constraint to use a Comparison<T> and returns self + + + + + Delegate used to delay evaluation of the actual value + to be used in evaluating a constraint + + + + + ConstraintBuilder maintains the stacks that are used in + processing a ConstraintExpression. An OperatorStack + is used to hold operators that are waiting for their + operands to be reognized. a ConstraintStack holds + input constraints as well as the results of each + operator applied. + + + + + Initializes a new instance of the class. + + + + + Appends the specified operator to the expression by first + reducing the operator stack and then pushing the new + operator on the stack. + + The operator to push. + + + + Appends the specified constraint to the expresson by pushing + it on the constraint stack. + + The constraint to push. + + + + Sets the top operator right context. + + The right context. + + + + Reduces the operator stack until the topmost item + precedence is greater than or equal to the target precedence. + + The target precedence. + + + + Resolves this instance, returning a Constraint. If the builder + is not currently in a resolvable state, an exception is thrown. + + The resolved constraint + + + + Gets a value indicating whether this instance is resolvable. + + + true if this instance is resolvable; otherwise, false. + + + + + OperatorStack is a type-safe stack for holding ConstraintOperators + + + + + Initializes a new instance of the class. + + The builder. + + + + Pushes the specified operator onto the stack. + + The op. + + + + Pops the topmost operator from the stack. + + + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Gets the topmost operator without modifying the stack. + + The top. + + + + ConstraintStack is a type-safe stack for holding Constraints + + + + + Initializes a new instance of the class. + + The builder. + + + + Pushes the specified constraint. As a side effect, + the constraint's builder field is set to the + ConstraintBuilder owning this stack. + + The constraint. + + + + Pops this topmost constrait from the stack. + As a side effect, the constraint's builder + field is set to null. + + + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Gets the topmost constraint without modifying the stack. + + The topmost constraint + + + + ConstraintExpression represents a compound constraint in the + process of being constructed from a series of syntactic elements. + + Individual elements are appended to the expression as they are + reognized. Once an actual Constraint is appended, the expression + returns a resolvable Constraint. + + + + + ConstraintExpressionBase is the abstract base class for the + ConstraintExpression class, which represents a + compound constraint in the process of being constructed + from a series of syntactic elements. + + NOTE: ConstraintExpressionBase is separate because the + ConstraintExpression class was generated in earlier + versions of NUnit. The two classes may be combined + in a future version. + + + + + The ConstraintBuilder holding the elements recognized so far + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the + class passing in a ConstraintBuilder, which may be pre-populated. + + The builder. + + + + Returns a string representation of the expression as it + currently stands. This should only be used for testing, + since it has the side-effect of resolving the expression. + + + + + + Appends an operator to the expression and returns the + resulting expression itself. + + + + + Appends a self-resolving operator to the expression and + returns a new ResolvableConstraintExpression. + + + + + Appends a constraint to the expression and returns that + constraint, which is associated with the current state + of the expression being built. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the + class passing in a ConstraintBuilder, which may be pre-populated. + + The builder. + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding only if a specified number of them succeed. + + + + + Returns a new PropertyConstraintExpression, which will either + test for the existence of the named property on the object + being tested or apply any following constraint to that property. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns the constraint provided as an argument - used to allow custom + custom constraints to easily participate in the syntax. + + + + + Returns the constraint provided as an argument - used to allow custom + custom constraints to easily participate in the syntax. + + + + + Returns a constraint that tests two items for equality + + + + + Returns a constraint that tests that two references are the same object + + + + + Returns a constraint that tests whether the + actual value is greater than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a collection containing the same elements as the + collection supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a subset of the collection supplied as an argument. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new ContainsConstraint. This constraint + will, in turn, make use of the appropriate second-level + constraint, depending on the type of the actual argument. + This overload is only used if the item sought is a string, + since any other type implies that we are looking for a + collection member. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the regular expression supplied as an argument. + + + + + Returns a constraint that tests whether the path provided + is the same as an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the actual value falls + within a specified range. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if at least one of them succeeds. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them fail. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Length property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Count property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Message property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the InnerException property of the object being tested. + + + + + With is currently a NOP - reserved for future use. + + + + + Returns a constraint that tests for null + + + + + Returns a constraint that tests for True + + + + + Returns a constraint that tests for False + + + + + Returns a constraint that tests for a positive value + + + + + Returns a constraint that tests for a negative value + + + + + Returns a constraint that tests for NaN + + + + + Returns a constraint that tests for empty + + + + + Returns a constraint that tests whether a collection + contains all unique items. + + + + + Returns a constraint that tests whether an object graph is serializable in binary format. + + + + + Returns a constraint that tests whether an object graph is serializable in xml format. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + 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. + + + + + EmptyCollectionConstraint tests whether a collection is empty. + + + + + Check that the collection is empty + + + + + + + Write the constraint description to a MessageWriter + + + + + + 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 + + + + 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 + + + + 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 + + + + EndsWithConstraint can test whether a string ends + with an expected substring. + + + + + 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 + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Test whether the constraint is satisfied by a given string + + The string to be tested + True for success, false for failure + + + + Modify the constraint to ignore case in matching. + + + + + 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 + + + + EqualConstraint is able to compare an actual value with the + expected value provided in its constructor. Two objects are + considered equal if both are null, or if both have the same + value. NUnit has special semantics for some object types. + + + + + If true, strings in error messages will be clipped + + + + + NUnitEqualityComparer used to test equality. + + + + + Initializes a new instance of the class. + + The expected value. + + + + Flag the constraint to use a tolerance when determining equality. + + Tolerance value to be used + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied Comparison object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write a failure message. Overridden to provide custom + failure messages for EqualConstraint. + + The MessageWriter to write to + + + + Write description of this constraint + + The MessageWriter to write to + + + + Display the failure information for two collections that did not match. + + The MessageWriter on which to display + The expected collection. + The actual collection + The depth of this failure in a set of nested collections + + + + Displays a single line showing the types and sizes of the expected + and actual enumerations, collections or arrays. If both are identical, + the value is only shown once. + + The MessageWriter on which to display + The expected collection or array + The actual collection or array + The indentation level for the message line + + + + Displays a single line showing the point in the expected and actual + arrays at which the comparison failed. If the arrays have different + structures or dimensions, both values are shown. + + The MessageWriter on which to display + The expected array + The actual array + Index of the failure point in the underlying collections + The indentation level for the message line + + + + Display the failure information for two IEnumerables that did not match. + + The MessageWriter on which to display + The expected enumeration. + The actual enumeration + The depth of this failure in a set of nested collections + + + + Flag the constraint to ignore case and return self. + + + + + Flag the constraint to suppress string clipping + and return self. + + + + + Flag the constraint to compare arrays as collections + and return self. + + + + + Switches the .Within() modifier to interpret its tolerance as + a distance in representable values (see remarks). + + Self. + + Ulp stands for "unit in the last place" and describes the minimum + amount a given value can change. For any integers, an ulp is 1 whole + digit. For floating point values, the accuracy of which is better + for smaller numbers and worse for larger numbers, an ulp depends + on the size of the number. Using ulps for comparison of floating + point results instead of fixed tolerances is safer because it will + automatically compensate for the added inaccuracy of larger numbers. + + + + + Switches the .Within() modifier to interpret its tolerance as + a percentage that the actual values is allowed to deviate from + the expected value. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in days. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in hours. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in minutes. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in seconds. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in milliseconds. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in clock ticks. + + Self + + + + EqualityAdapter class handles all equality comparisons + that use an IEqualityComparer, IEqualityComparer<T> + or a ComparisonAdapter. + + + + + Compares two objects, returning true if they are equal + + + + + Returns true if the two objects can be compared by this adapter. + The base adapter cannot handle IEnumerables except for strings. + + + + + Returns an EqualityAdapter that wraps an IComparer. + + + + + Returns an EqualityAdapter that wraps an IEqualityComparer. + + + + + Returns an EqualityAdapter that wraps an IEqualityComparer<T>. + + + + + Returns an EqualityAdapter that wraps an IComparer<T>. + + + + + Returns an EqualityAdapter that wraps a Comparison<T>. + + + + + EqualityAdapter that wraps an IComparer. + + + + + Returns true if the two objects can be compared by this adapter. + Generic adapter requires objects of the specified type. + + + + + EqualityAdapter that wraps an IComparer. + + + + + EqualityAdapterList represents a list of EqualityAdapters + in a common class across platforms. + + + + + ExactCountConstraint applies another constraint to each + item in a collection, succeeding only if a specified + number of items succeed. + + + + + Construct an ExactCountConstraint on top of an existing constraint + + + + + + + Apply the item constraint to each item in the collection, + succeeding only if the expected number of items pass. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + ExactTypeConstraint is used to test that an object + is of the exact type provided in the constructor + + + + + Construct an ExactTypeConstraint for a given Type + + The expected Type. + + + + Test that an object is of the exact type specified + + The actual value. + True if the tested object is of the exact type provided, otherwise false. + + + + Write the description of this constraint to a MessageWriter + + The MessageWriter to use + + + + ExceptionTypeConstraint is a special version of ExactTypeConstraint + used to provided detailed info about the exception thrown in + an error message. + + + + + Constructs an ExceptionTypeConstraint + + + + + Write the actual value for a failing constraint test to a + MessageWriter. Overriden to write additional information + in the case of an Exception. + + The MessageWriter to use + + + + FailurePoint class represents one point of failure + in an equality test. + + + + + The location of the failure + + + + + The expected value + + + + + The actual value + + + + + Indicates whether the expected value is valid + + + + + Indicates whether the actual value is valid + + + + + FailurePointList represents a set of FailurePoints + in a cross-platform way. + + + + + FalseConstraint tests that the actual value is false + + + + + Initializes a new instance of the class. + + + + Helper routines for working with floating point numbers + + + The floating point comparison code is based on this excellent article: + http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm + + + "ULP" means Unit in the Last Place and in the context of this library refers to + the distance between two adjacent floating point numbers. IEEE floating point + numbers can only represent a finite subset of natural numbers, with greater + accuracy for smaller numbers and lower accuracy for very large numbers. + + + If a comparison is allowed "2 ulps" of deviation, that means the values are + allowed to deviate by up to 2 adjacent floating point values, which might be + as low as 0.0000001 for small numbers or as high as 10.0 for large numbers. + + + + + Compares two floating point values for equality + First floating point value to be compared + Second floating point value t be compared + + Maximum number of representable floating point values that are allowed to + be between the left and the right floating point values + + True if both numbers are equal or close to being equal + + + Floating point values can only represent a finite subset of natural numbers. + For example, the values 2.00000000 and 2.00000024 can be stored in a float, + but nothing inbetween them. + + + This comparison will count how many possible floating point values are between + the left and the right number. If the number of possible values between both + numbers is less than or equal to maxUlps, then the numbers are considered as + being equal. + + + Implementation partially follows the code outlined here: + http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/ + + + + + Compares two double precision floating point values for equality + First double precision floating point value to be compared + Second double precision floating point value t be compared + + Maximum number of representable double precision floating point values that are + allowed to be between the left and the right double precision floating point values + + True if both numbers are equal or close to being equal + + + Double precision floating point values can only represent a limited series of + natural numbers. For example, the values 2.0000000000000000 and 2.0000000000000004 + can be stored in a double, but nothing inbetween them. + + + This comparison will count how many possible double precision floating point + values are between the left and the right number. If the number of possible + values between both numbers is less than or equal to maxUlps, then the numbers + are considered as being equal. + + + Implementation partially follows the code outlined here: + http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/ + + + + + + Reinterprets the memory contents of a floating point value as an integer value + + + Floating point value whose memory contents to reinterpret + + + The memory contents of the floating point value interpreted as an integer + + + + + Reinterprets the memory contents of a double precision floating point + value as an integer value + + + Double precision floating point value whose memory contents to reinterpret + + + The memory contents of the double precision floating point value + interpreted as an integer + + + + + Reinterprets the memory contents of an integer as a floating point value + + Integer value whose memory contents to reinterpret + + The memory contents of the integer value interpreted as a floating point value + + + + + Reinterprets the memory contents of an integer value as a double precision + floating point value + + Integer whose memory contents to reinterpret + + The memory contents of the integer interpreted as a double precision + floating point value + + + + Union of a floating point variable and an integer + + + The union's value as a floating point variable + + + The union's value as an integer + + + The union's value as an unsigned integer + + + Union of a double precision floating point variable and a long + + + The union's value as a double precision floating point variable + + + The union's value as a long + + + The union's value as an unsigned long + + + + Tests whether a value is greater than the value supplied to its constructor + + + + + The value against which a comparison is to be made + + + + + Initializes a new instance of the class. + + The expected value. + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Tests whether a value is greater than or equal to the value supplied to its constructor + + + + + The value against which a comparison is to be made + + + + + Initializes a new instance of the class. + + The expected value. + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + 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 + + + + Tests whether a value is less than the value supplied to its constructor + + + + + The value against which a comparison is to be made + + + + + Initializes a new instance of the class. + + The expected value. + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Tests whether a value is less than or equal to the value supplied to its constructor + + + + + The value against which a comparison is to be made + + + + + Initializes a new instance of the class. + + The expected value. + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Static methods used in creating messages + + + + + Static string used when strings are clipped + + + + + Returns the representation of a type as used in NUnitLite. + This is the same as Type.ToString() except for arrays, + which are displayed with their declared sizes. + + + + + + + Converts any control characters in a string + to their escaped representation. + + The string to be converted + The converted string + + + + Return the a string representation for a set of indices into an array + + Array of indices for which a string is needed + + + + Get an array of indices representing the point in a enumerable, + collection or array corresponding to a single int index into the + collection. + + The collection to which the indices apply + Index in the collection + Array of indices + + + + Clip a string to a given length, starting at a particular offset, returning the clipped + string with ellipses representing the removed parts + + The string to be clipped + The maximum permitted length of the result string + The point at which to start clipping + The clipped string + + + + Clip the expected and actual strings in a coordinated fashion, + so that they may be displayed together. + + + + + + + + + Shows the position two strings start to differ. Comparison + starts at the start index. + + The expected string + The actual string + The index in the strings at which comparison should start + Boolean indicating whether case should be ignored + -1 if no mismatch found, or the index where mismatch found + + + + 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 + + + + + + NoItemConstraint applies another constraint to each + item in a collection, failing if any of them succeeds. + + + + + Construct a NoItemConstraint on top of an existing constraint + + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + 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 + + + + NullConstraint tests that the actual value is null + + + + + Initializes a new instance of the class. + + + + + 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 + + + + The Numerics class contains common operations on numeric values. + + + + + Checks the type of the object, returning true if + the object is a numeric type. + + The object to check + true if the object is a numeric type + + + + Checks the type of the object, returning true if + the object is a floating point numeric type. + + The object to check + true if the object is a floating point numeric type + + + + Checks the type of the object, returning true if + the object is a fixed point numeric type. + + The object to check + true if the object is a fixed point numeric type + + + + Test two numeric values for equality, performing the usual numeric + conversions and using a provided or default tolerance. If the tolerance + provided is Empty, this method may set it to a default tolerance. + + The expected value + The actual value + A reference to the tolerance in effect + True if the values are equal + + + + Compare two numeric values, performing the usual numeric conversions. + + The expected value + The actual value + The relationship of the values to each other + + + + NUnitComparer encapsulates NUnit's default behavior + in comparing two objects. + + + + + Compares two objects + + + + + + + + Returns the default NUnitComparer. + + + + + Generic version of NUnitComparer + + + + + + Compare two objects of the same type + + + + + NUnitEqualityComparer encapsulates NUnit's handling of + equality tests between objects. + + + + + + + + + + Compares two objects for equality within a tolerance + + The first object to compare + The second object to compare + The tolerance to use in the comparison + + + + + If true, all string comparisons will ignore case + + + + + If true, arrays will be treated as collections, allowing + those of different dimensions to be compared + + + + + Comparison objects used in comparisons for some constraints. + + + + + List of points at which a failure occured. + + + + + RecursionDetector used to check for recursion when + evaluating self-referencing enumerables. + + + + + Compares two objects for equality within a tolerance, setting + the tolerance to the actual tolerance used if an empty + tolerance is supplied. + + + + + 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 the list of external comparers to be used to + test for equality. They are applied to members of + collections, in place of NUnit's own logic. + + + + + Gets the list of failure points for the last Match performed. + The list consists of objects to be interpreted by the caller. + This generally means that the caller may only make use of + objects it has placed on the list at a particular depthy. + + + + + RecursionDetector detects when a comparison + between two enumerables has reached a point + where the same objects that were previously + compared are again being compared. This allows + the caller to stop the comparison if desired. + + + + + Check whether two objects have previously + been compared, returning true if they have. + The two objects are remembered, so that a + second call will always return true. + + + + + 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 + + + + PathConstraint serves as the abstract base of constraints + that operate on paths and provides several helper methods. + + + + + The expected path used in the constraint + + + + + 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 + + + + + Transform the provided path to its canonical form so that it + may be more easily be compared with other paths. + + The original path + The path in canonical form + + + + Test whether one path in canonical form is under another. + + The first path - supposed to be the parent path + The second path - supposed to be the child path + Indicates whether case should be ignored + + + + + Modifies the current instance to be case-insensitve + and returns it. + + + + + Modifies the current instance to be case-sensitve + and returns it. + + + + + 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 + + + + + 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. + + + + + + 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. + + + + + + RangeConstraint tests whether 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 + + + + 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 + + + + ResolvableConstraintExpression is used to represent a compound + constraint being constructed at a point where the last operator + may either terminate the expression or may have additional + qualifying constraints added to it. + + It is used, for example, for a Property element or for + an Exception element, either of which may be optionally + followed by constraints that apply to the property or + exception. + + + + + Create a new instance of ResolvableConstraintExpression + + + + + Create a new instance of ResolvableConstraintExpression, + passing in a pre-populated ConstraintBuilder. + + + + + Resolve the current expression to a Constraint + + + + + This operator creates a constraint that is satisfied only if both + argument constraints are satisfied. + + + + + This operator creates a constraint that is satisfied only if both + argument constraints are satisfied. + + + + + This operator creates a constraint that is satisfied only if both + argument constraints are satisfied. + + + + + This operator creates a constraint that is satisfied if either + of the argument constraints is satisfied. + + + + + This operator creates a constraint that is satisfied if either + of the argument constraints is satisfied. + + + + + This operator creates a constraint that is satisfied if either + of the argument constraints is satisfied. + + + + + This operator creates a constraint that is satisfied if the + argument constraint is not satisfied. + + + + + Appends an And Operator to the expression + + + + + Appends an Or operator to the expression. + + + + + ReusableConstraint wraps a constraint expression after + resolving it so that it can be reused consistently. + + + + + Construct a ReusableConstraint from a constraint expression + + The expression to be resolved and reused + + + + Converts a constraint to a ReusableConstraint + + The constraint to be converted + A ReusableConstraint + + + + Returns 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 + + + + 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 + + + + 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 + + + + 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 + + + + + + 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 + + + + 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 + + + + 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 + + + + 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 + + + + 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. Overridden in ThrowsNothingConstraint to write + information about the exception that was actually caught. + + The writer on which the actual value is displayed + + + + The Tolerance class generalizes the notion of a tolerance + within which an equality test succeeds. Normally, it is + used with numeric types, but it can be used with any + type that supports taking a difference between two + objects and comparing that difference to a value. + + + + + Constructs a linear tolerance of a specdified amount + + + + + Constructs a tolerance given an amount and ToleranceMode + + + + + Tests that the current Tolerance is linear with a + numeric value, throwing an exception if it is not. + + + + + Returns an empty Tolerance object, equivalent to + specifying no tolerance. In most cases, it results + in an exact match but for floats and doubles a + default tolerance may be used. + + + + + Returns a zero Tolerance object, equivalent to + specifying an exact match. + + + + + Gets the ToleranceMode for the current Tolerance + + + + + Gets the value of the current Tolerance instance. + + + + + Returns a new tolerance, using the current amount as a percentage. + + + + + Returns a new tolerance, using the current amount in Ulps. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of days. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of hours. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of minutes. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of seconds. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of milliseconds. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of clock ticks. + + + + + Returns true if the current tolerance is empty. + + + + + Modes in which the tolerance value for a comparison can be interpreted. + + + + + The tolerance was created with a value, without specifying + how the value would be used. This is used to prevent setting + the mode more than once and is generally changed to Linear + upon execution of the test. + + + + + The tolerance is used as a numeric range within which + two compared values are considered to be equal. + + + + + Interprets the tolerance as the percentage by which + the two compared values my deviate from each other. + + + + + Compares two values based in their distance in + representable numbers. + + + + + TrueConstraint tests that the actual value is true + + + + + Initializes a new instance of the class. + + + + + 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 + + + + + + XmlSerializableConstraint tests whether + an object is serializable in XML 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 + + + + + Represents a constraint that succeeds if all the + members of a collection match a base constraint. + + + + + Abstract base for operators that indicate how to + apply a constraint to items in a collection. + + + + + PrefixOperator takes a single constraint and modifies + it's action in some way. + + + + + 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. + + + + + 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. + + + + + + + Constructs a CollectionOperator + + + + + Returns a constraint that will apply the argument + to the members of a collection, succeeding if + they all succeed. + + + + + Operator that requires both it's arguments to succeed + + + + + 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 + + + + + Construct an AndOperator + + + + + Apply the operator to produce an AndConstraint + + + + + Operator that tests for the presence of a particular attribute + on a type and optionally applies further tests to the attribute. + + + + + Abstract base class for operators that are able to reduce to a + constraint whether or not another syntactic element follows. + + + + + 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. + + + + + Represents a constraint that succeeds if the specified + count of members of a collection match a base constraint. + + + + + Construct an ExactCountOperator for a specified count + + The expected count + + + + Returns a constraint that will apply the argument + to the members of a collection, succeeding if + none of them succeed. + + + + + Represents a constraint that succeeds if none of the + members of a collection match a base constraint. + + + + + Returns a constraint that will apply the argument + to the members of a collection, succeeding if + none of them succeed. + + + + + Negates the test of the constraint it wraps. + + + + + Constructs a new NotOperator + + + + + Returns a NotConstraint applied to its argument. + + + + + Operator that requires at least one of it's arguments to succeed + + + + + Construct an OrOperator + + + + + Apply the operator to produce an OrConstraint + + + + + 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 + + + + + Represents a constraint that succeeds if any of the + members of a collection match a base constraint. + + + + + Returns a constraint that will apply the argument + to the members of a collection, succeeding if + any of them succeed. + + + + + Operator that tests that an exception is thrown and + optionally applies further tests to the exception. + + + + + Construct a ThrowsOperator + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + Represents a constraint that simply wraps the + constraint provided as an argument, without any + further functionality, but which modifes the + order of evaluation because of its precedence. + + + + + Constructor for the WithOperator + + + + + Returns a constraint that wraps its argument + + + + + Thrown when an assertion failed. + + + + The error message that explains + the reason for the exception + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Thrown when a test executes inconclusively. + + + + The error message that explains + the reason for the exception + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + + + + + + + Compares two objects of a given Type for equality within a tolerance + + The first object to compare + The second object to compare + The tolerance to use in the comparison + + + + diff -r 000000000000 -r 5bca2d201ad8 src/packages/NUnit.2.6.3/license.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/packages/NUnit.2.6.3/license.txt Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,15 @@ +Copyright 2002-2013 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-2013 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 -r 000000000000 -r 5bca2d201ad8 src/packages/Unity.3.0.1304.1/Unity.3.0.1304.1.nupkg Binary file src/packages/Unity.3.0.1304.1/Unity.3.0.1304.1.nupkg has changed diff -r 000000000000 -r 5bca2d201ad8 src/packages/Unity.3.0.1304.1/Unity.3.0.1304.1.nuspec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/packages/Unity.3.0.1304.1/Unity.3.0.1304.1.nuspec Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,17 @@ + + + + Unity + 3.0.1304.1 + Unity + Microsoft + Microsoft + http://www.opensource.org/licenses/ms-pl + http://msdn.microsoft.com/unity + http://nuget.org/Media/Default/Packages/Unity/2.0/entlib_new_icon_100x100.png + true + The Unity Application Block (Unity) is a lightweight extensible dependency injection container with support for constructor, property, and method call injection. It facilitates loosely-coupled design. + The Unity Application Block (Unity) is a lightweight extensible dependency injection container with support for constructor, property, and method call injection. + Unity EntLib EntLib6 IoC DI container dependency injection inversion control LOB WinRT Win8 Windows8 NetCore WindowsStoreApps WindowsStore + + \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/packages/Unity.3.0.1304.1/UnityConfiguration30.xsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/packages/Unity.3.0.1304.1/UnityConfiguration30.xsd Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,319 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 5bca2d201ad8 src/packages/Unity.3.0.1304.1/lib/Net45/Microsoft.Practices.Unity.Configuration.dll Binary file src/packages/Unity.3.0.1304.1/lib/Net45/Microsoft.Practices.Unity.Configuration.dll has changed diff -r 000000000000 -r 5bca2d201ad8 src/packages/Unity.3.0.1304.1/lib/Net45/Microsoft.Practices.Unity.Configuration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/packages/Unity.3.0.1304.1/lib/Net45/Microsoft.Practices.Unity.Configuration.xml Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,2451 @@ + + + + Microsoft.Practices.Unity.Configuration + + + + + A configuration element storing information about a single type alias. + + + + + Base class for configuration elements with a default implementation of + public deserialization. + + + + + Load this element from the given . + + Contains the XML to initialize from. + + + + Write the contents of this element to the given . + + The caller of this method has already written the start element tag before + calling this method, so deriving classes only need to write the element content, not + the start or end tags. + Writer to send XML content to. + + + + Construct a new, uninitialized . + + + + + Construct a new that is initialized + to alias to the target . + + Alias to use. + Type that is aliased. + + + + Write the contents of this element to the given . + + The caller of this method has already written the start element tag before + calling this method, so deriving classes only need to write the element content, not + the start or end tags. + Writer to send XML content to. + + + + The alias used for this type. + + + + + The fully qualified name this alias refers to. + + + + + A collection of s. + + + + + Specialization of + that provides a canned implmentation of . + + Type of configuration element in the collection. + + + + A base helper class for implementing configuration collections. + + Type of configuration element contained in + the collection. + + + + Plug point to get objects out of the collection. + + Index in the collection to retrieve the item from. + Item at that index or null if not present. + + + + Plug point to get objects out of the collection. + + Key to look up the object by. + Item with that key or null if not present. + + + + Load this element from the given . + + Contains the XML to initialize from. + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + 1 + + + + Add a new element to the collection. + + Element to add. + + + + Remove an element from the collection at the given index. + + The index of the item to remove. + + + + Remove all the items in the collection. + + + + + Write out the contents of this collection to the given + without a containing element + corresponding directly to this container element. Each + child element will have a tag name given by + . + + to output XML to. + Name of tag to generate. + + + + Indexer to retrieve items in the collection by index. + + Index of the item to get or set. + The item at the given index. + + + + When overridden in a derived class, creates a new . + + + A new . + + + + + Causes the configuration system to throw an exception. + + + true if the unrecognized element was deserialized successfully; otherwise, false. The default is false. + + The name of the unrecognized element. + An input stream that reads XML from the configuration file. + The element specified in is the <clear> element. + starts with the reserved prefix "config" or "lock". + + + + + Gets the element key for a specified configuration element when overridden in a derived class. + + + An that acts as the key for the specified . + + The to return the key for. + + + + + Indexer that allows you to get or set an alias by the alias name. + + Alias of element to get or set. + The type name at that alias. + + + + A configuration element used to configure injection of + a specific set of values into an array. + + + + + Base class for configuration elements that describe a value that will + be injected. + + + + + Initialize a new instance of . + + + + + Generate an object + that will be used to configure the container for a type registration. + + Container that is being configured. Supplied in order + to let custom implementations retrieve services; do not configure the container + directly in this method. + Type of the + + + + + Validate that an expected attribute is present in the given + dictionary and that it has a non-empty value. + + Dictionary of name/value pairs to check. + attribute name to check. + + + + Return a unique string that can be used to identify this object. Used + by the configuration collection support. + + + + + Write the contents of this element to the given . + + The caller of this method has already written the start element tag before + calling this method, so deriving classes only need to write the element content, not + the start or end tags. + Writer to send XML content to. + + + + Generate an object + that will be used to configure the container for a type registration. + + Container that is being configured. Supplied in order + to let custom implementations retrieve services; do not configure the container + directly in this method. + Type of the + + + + + Type of array to inject. This is actually the type of the array elements, + not the array type. Optional, if not specified we take the type from + our containing element. + + + + + Values used to calculate the contents of the array. + + + + + A configuration element representing the namespace + tags in the config file. + + + + + An element with a single "name" property, used for + the namespaces and assemblies. + + + + + Write the contents of this element to the given . + + The caller of this method has already written the start element tag before + calling this method, so deriving classes only need to write the element content, not + the start or end tags. + Writer to send XML content to. + + + + Name attribute for this element. + + + + + A collection of s in configuration. + + + + + Gets the element key for a specified configuration element when overridden in a derived class. + + + An that acts as the key for the specified . + + The to return the key for. + + + + + Helpful extension methods when implementing configuration sections + that deserialize "unwrapped" elements - elements that should be + deserialized into a container but can be present outside + that container in the actual config file. + + + + + Deserialize an element of the given type, store it in + the collection object, and + + Type of element to create and deserialize. + Parent element containing element to deserialize. + Xml reader containing state to deserialize from. + Collection to store the created element into. + The created element. + + + + Deserialize an element, basing the element type on the one + supplied at runtime, and then store the element into the + given . + + This method is useful when reading elements into a polymorphic collection. + Base type of element to store. + Element that contains the collection being stored into. + Xml Reader containing state to deserialize from. + Runtime type of element to create. + Collection to store the created element into. + The created element. + + + + Class that tracks the current input state of the parser. + + + + + A simple implementing of the rules for a Parsing Expression Grammar + parsing algorithm. This supplies basic methods to do the primitives + of the PEG, and combinators to create larger rules. + + + + + The PEG "dot" operator that matches and consumes one character. + + Input to the parser. + The parse result. + + + + Parse function generator that returns a method to match a single, + specific character. + + Character to match. + The generated parsing function. + + + + Parse function generator that checks if the current character matches + the predicate supplied. + + Predicate used to determine if the character is in + the given range. + The generated parsing function. + + + + The "*" operator - match zero or more of the inner parse expressions. + + Parse method to repeat matching. + The generated parsing function. + + + + Parsing combinator that matches all of the given expressions in + order, or matches none of them. + + Expressions that form the sequence to match. + The combined sequence. + + + + Parsing combinator that implements the PEG prioritized choice operator. Basically, + try each of the expressions in order, and match if any of them match, stopping on the + first match. + + Expressions that form the set of alternatives. + The combined parsing method. + + + + Parsing combinator implementing the "not" predicate. This wraps + the given parsing method with a check + to see if it matched. If it matched, then the Not fails, and vice + versa. The result consumes no input. + + The parse method to wrap. + The generated parsing function. + + + + Parsing expression that matches End of input. + + Parser input. + Parse result + + + + Combinator that executes an action if the given expression matched. + + Parsing expression to match. + Action to execute if + matched. Input is the matched text from . + The result of . + + + + Combinator that executes an action if the given expression matched. + + parsing expression to match. + Method to execute if a match happens. This method returns + the that will be returned from the combined expression. + The result of if expression matched, else + whatever returned. + + + + Object containing the result of attempting to match a PEG rule. + This object is the return type for all parsing methods. + + + + + Did the rule match? + + + + + The characters that were matched (if any) + + + + + Any extra information provided by the parsing expression + (only set if the parse matched). The nature + of the data varies depending on the parsing expression. + + + + + Helper methods to make it easier to pull the data + out of the result of a sequence expression. + + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + 2 + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + 1 + + + + Adds an item to the . + + The object to add to the . + The is read-only. + + + + + Removes all items from the . + + The is read-only. + + + + + Determines whether the contains a specific value. + + + true if is found in the ; otherwise, false. + + The object to locate in the . + + + + + Copies the elements of the sequence to an , starting at a particular index. + + The one-dimensional that is the destination of the elements copied from this sequence. The must have zero-based indexing. + The zero-based index in at which copying begins. + is null. + is less than 0. + is multidimensional. + -or- + is equal to or greater than the length of . + -or- + The number of elements in the source is greater than the available space from to the end of the destination . + + + + + Removes the first occurrence of a specific object from the . + + + true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . + + The object to remove from the . + The is read-only. + + + + + Determines the index of a specific item in the . + + + The index of if found in the list; otherwise, -1. + + The object to locate in the . + + + + + Inserts an item to the at the specified index. + + The zero-based index at which should be inserted. + The object to insert into the . + is not a valid index in the . + The is read-only. + + + + + Removes the item at the specified index. + + The zero-based index of the item to remove. + is not a valid index in the . + The is read-only. + + + + + Gets the number of elements contained in the . + + + The number of elements contained in the . + + + + + Gets a value indicating whether the is read-only. + + + true if the is read-only; otherwise, false. + + + + + Gets or sets the element at the specified index. + + + The element at the specified index. + + The zero-based index of the element to get or set. + is not a valid index in the . + The property is set and the is read-only. + + + + + Class containing information about a type name. + + + + + The base name of the class + + + + + Namespace if any + + + + + Assembly name, if any + + + + + Helper methods on . + + + + + A helper method to make it more foolproof to write elements. This takes care of writing the + start and end elment tags, and takes a nested closure with the code to write the content of + the tag. That way the caller doesn't need to worry about the details of getting the start + and end tags correct. + + + We don't support XML Namespaces here because .NET configuration doesn't use them so + we don't need it for this current implementation. + + XmlWriter to write to. + Name of element. + Nested lambda which, when executed, will create the content for the + element. + (for method chaining if desired). + + + + A helper method to make it easier to output attributes. If the is + null or an empty string, output nothing, else output the given XML attribute. + + Writer to output to. + Attribute name to write. + Value for the attribute. + (for method chaining if desired). + + + + A base class for those elements that can be used + to configure a unity container. + + + + + Create a new instance of . + + + + + Apply this element's configuration to the given . + + Container to configure. + + + + Return a unique key that can be used to manage this element in a collection. + + + + + A couple of useful extension methods on IDictionary + + + + + Get the value from a dictionary, or null if there is no value. + + Key type of dictionary. + Value type of dictionary. + Dictionary to search. + Key to look up. + The value at the key or null if not in the dictionary. + + + + A helper class used to map element tag names to a handler method + used to interpret that element. + + + + + + Add method to enable dictionary initializer syntax + + + + + + + Process an unknown element according to the map entries. + + Parent element that hit this unknown element. + Name of the unknown element. + XmlReader positioned at start of element. + true if processed, false if not. + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + 2 + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + 1 + + + + A helper class used to map element tag names to a handler method + used to interpret that element. + + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + 2 + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + 1 + + + + A helper class that assists in deserializing parameter and property + elements. These elements both have a single "value" child element that + specify the value to inject for the property or parameter. + + + + + Create a new that wraps reading + values and storing them in the given . + + Element that contains the value elements. + + + + Gets a , or if none is present, + returns a default . + + The . + The given , unless + is null, in which case returns + a . + + + + Helper method used during deserialization to handle + attributes for the dependency and value tags. + + attribute name. + attribute value. + true + + + + Helper method used during deserialization to handle the default + value element tags. + + The element name. + XML data to read. + True if deserialization succeeded, false if it failed. + + + + Call this method at the end of deserialization of your element to + set your value element. + + + + + Serialize a object out to XML. + This method is aware of and implements the shorthand attributes + for dependency and value elements. + + Writer to output XML to. + The to serialize. + If true, always output an element. If false, then + dependency and value elements will be serialized as attributes in the parent tag. + + + + Configuration element representing a constructor configuration. + + + + + Base class for configuration elements that generate + object to configure a container. + + + + + Return the set of s that are needed + to configure the container according to this configuration element. + + Container that is being configured. + Type that is being registered. + Type that is being mapped to. + Name this registration is under. + One or more objects that should be + applied to the container registration. + + + + Get the standard tag name for an + taking into account currently loaded section extensions. + + Element to get the name for. + The element name. + If the member element is not currently registered + with the section. + + + + Each element must have a unique key, which is generated by the subclasses. + + + + + Element name to use to serialize this into XML. + + + + + Write the contents of this element to the given . + + The caller of this method has already written the start element tag before + calling this method, so deriving classes only need to write the element content, not + the start or end tags. + Writer to send XML content to. + + + + Return the set of s that are needed + to configure the container according to this configuration element. + + Container that is being configured. + Type that is being registered. + Type that is being mapped to. + Name this registration is under. + One or more objects that should be + applied to the container registration. + + + + The parameters of the constructor to call. + + + + + Each element must have a unique key, which is generated by the subclasses. + + + + + Element name to use to serialize this into XML. + + + + + A collection of s as + loaded from configuration. + + + + + When overridden in a derived class, creates a new . + + + A new . + + + + + Gets the element key for a specified configuration element when overridden in a derived class. + + + An that acts as the key for the specified . + + The to return the key for. + + + + + A configuration element class defining the set of registrations to be + put into a container. + + + + + Original configuration API kept for backwards compatibility. + + Container to configure + + + + Apply the configuration information in this element to the + given . + + Container to configure. + + + + Gets a value indicating whether an unknown element is encountered during deserialization. + + + true when an unknown element is encountered while deserializing; otherwise, false. + + The name of the unknown subelement. + The being used for deserialization. + The element identified by is locked. + - or - + One or more of the element's attributes is locked. + - or - + is unrecognized, or the element has an unrecognized attribute. + - or - + The element has a Boolean attribute with an invalid value. + - or - + An attempt was made to deserialize a property more than once. + - or - + An attempt was made to deserialize a property that is not a valid member of the element. + - or - + The element cannot contain a CDATA or text element. + + + + + Write the contents of this element to the given . + + The caller of this method has already written the start element tag before + calling this method, so deriving classes only need to write the element content, not + the start or end tags. + Writer to send XML content to. + + + + Name for this container configuration as given in the config file. + + + + + The type registrations in this container. + + + + + Any instances to register in the container. + + + + + Any extensions to add to the container. + + + + + Set of any extra configuration elements that were added by a + section extension. + + + This is not marked as a configuration property because we don't want + the actual property to show up as a nested element in the configuration. + + + + Configuration element representing an extension to add to a container. + + + + + Add the extension specified in this element to the container. + + Container to configure. + + + + Write the contents of this element to the given . + + The caller of this method has already written the start element tag before + calling this method, so deriving classes only need to write the element content, not + the start or end tags. + Writer to send XML content to. + + + + Type of the extension to add. + + + + + A collection of s. + + + + + Gets the element key for a specified configuration element when overridden in a derived class. + + + An that acts as the key for the specified . + + The to return the key for. + + + + + A derived class that describes + a parameter that should be resolved through the container. + + + + + Create a new instance of . + + + + + Create a new instance of with + properties initialized from the contents of + . + + Dictionary of name/value pairs to + initialize this object with. + + + + Write the contents of this element to the given . + + The caller of this method has already written the start element tag before + calling this method, so deriving classes only need to write the element content, not + the start or end tags. + Writer to send XML content to. + + + + Write the contents of this element to the given . This + method always outputs an explicit <dependency> tag, instead of providing + attributes to the parent method. + + Writer to send XML content to. + + + + Generate an object + that will be used to configure the container for a type registration. + + Container that is being configured. Supplied in order + to let custom implementations retrieve services; do not configure the container + directly in this method. + Type of the + + + + + Name to use to when resolving. If empty, resolves the default. + + + + + Name of type this dependency should resolve to. This is optional; + without it the container will resolve the type of whatever + property or parameter this element is contained in. + + + + + Base class used to derive new elements that can occur + directly within a container element. + + + + + Initialize a new instance of . + + + + + When overridden in a derived class, this method will make configuration + calls into the given according to its contents. + + The container to configure. + + + + Unique key generated for use in the collection class. + + + + + A collection of s. + + + + + When overridden in a derived class, creates a new . + + + A new . + + + + + Gets the element key for a specified configuration element when overridden in a derived class. + + + An that acts as the key for the specified . + + The to return the key for. + + + + + This class manages the set of extension elements + added by section elements. + + + + + Clear the current set of extension elements. + + + + + Register a new ContainerExtensionConfigurationElement with he section so it + can be read. + + prefix if any. + tag name. + Type of element to register. + + + + Register a new with the section + so it can be read. + + prefix if any. + Tag name. + Type of element to register. + + + + Register a new with the section + so it can be read. + + prefix if any. + Tag name. + Type of element to register. + + + + Retrieve the registered for the given + tag. + + Tag to look up. + Type of element, or null if not registered. + + + + Retrieve the ContainerExtensionConfigurationElement registered for the given + tag. + + Tag to look up. + Type of element, or null if not registered. + + + + Retrieve the ContainerExtensionConfigurationElement registered for the given + tag. + + Tag to look up. + Type of element, or null if not registered. + + + + Retrieve the correct tag to use when serializing the given + to XML. + + Element to be serialized. + The tag for that element type. + if the element is of a type that + is not registered with the section already. + + + + A polymorphic collection of s. + + + + + Causes the configuration system to throw an exception. + + + true if the unrecognized element was deserialized successfully; otherwise, false. The default is false. + + The name of the unrecognized element. + An input stream that reads XML from the configuration file. + The element specified in is the <clear> element. + starts with the reserved prefix "config" or "lock". + + + + + When overridden in a derived class, creates a new . + + + A new . + + + + + Gets the element key for a specified configuration element when overridden in a derived class. + + + An that acts as the key for the specified . + + The to return the key for. + + + + + Indexer that lets you access elements by their key. + + Key to retrieve element with. + The element. + + + + A configuration element that describes an instance to add to the container. + + + + + Write the contents of this element to the given . + + The caller of this method has already written the start element tag before + calling this method, so deriving classes only need to write the element content, not + the start or end tags. + Writer to send XML content to. + + + + Add the instance defined by this element to the given container. + + Container to configure. + + + + Name to register instance under + + + + + Value for this instance + + + + + Type of the instance. If not given, defaults to string + + + + + Type name for the type converter to use to create the instance. If not + given, defaults to the default type converter for this instance type. + + + + + Key used to keep these instances unique in the config collection. + + + + + A collection of s. + + + + + Gets the element key for a specified configuration element when overridden in a derived class. + + + An that acts as the key for the specified . + + The to return the key for. + + + + + An element that has a child Value property. + + + + + String that will be deserialized to provide the value. + + + + + A string describing where the value this element contains + is being used. For example, if setting a property Prop1, + this should return "property Prop1" (in english). + + + + + A configuration element that represents lifetime managers. + + + + + Create the described by + this element. + + A instance. + + + + Write the contents of this element to the given . + + The caller of this method has already written the start element tag before + calling this method, so deriving classes only need to write the element content, not + the start or end tags. + Writer to send XML content to. + + + + Type of the lifetime manager. + + + + + Extra initialization information used by the type converter for this lifetime manager. + + + + + Type of to use to create the + lifetime manager. + + + + + A configuration element representing a method to call. + + + + + Construct a new instance of . + + + + + Write the contents of this element to the given . + + The caller of this method has already written the start element tag before + calling this method, so deriving classes only need to write the element content, not + the start or end tags. + Writer to send XML content to. + + + + Return the set of s that are needed + to configure the container according to this configuration element. + + Container that is being configured. + Type that is being registered. + Type that is being mapped to. + Name this registration is under. + One or more objects that should be + applied to the container registration. + + + + Name of the method to call. + + + + + Parameters to the method call. + + + + + Each element must have a unique key, which is generated by the subclasses. + + + + + Element name to use to serialize this into XML. + + + + + A configuration element representing the namespace + tags in the config file. + + + + + A collection of s in configuration. + + + + + Gets the element key for a specified configuration element when overridden in a derived class. + + + An that acts as the key for the specified . + + The to return the key for. + + + + + A configuration element that specifies that a value + is optional. + + + + + Write the contents of this element to the given . + + The caller of this method has already written the start element tag before + calling this method, so deriving classes only need to write the element content, not + the start or end tags. + Writer to send XML content to. + + + + Generate an object + that will be used to configure the container for a type registration. + + Container that is being configured. Supplied in order + to let custom implementations retrieve services; do not configure the container + directly in this method. + Type of the + + + + + Name used to resolve the dependency, leave out or blank to resolve default. + + + + + Type of dependency to resolve. If left out, resolved the type of + the containing parameter or property. + + + + + Configuration element representing a parameter passed to a constructor + or a method. + + + + + Construct a new instance of . + + + + + Returns the required needed + to configure the container so that the correct value is injected. + + Container being configured. + Type of the parameter. + The value to use to configure the container. + + + + Does the information in this match + up with the given ? + + Information about the parameter. + True if this is a match, false if not. + + + + Reads XML from the configuration file. + + The that reads from the configuration file. + true to serialize only the collection key properties; otherwise, false. + The element to read is locked. + - or - + An attribute of the current node is not recognized. + - or - + The lock status of the current node cannot be determined. + + + + + Gets a value indicating whether an unknown attribute is encountered during deserialization. + + + true when an unknown attribute is encountered while deserializing; otherwise, false. + + The name of the unrecognized attribute. + The value of the unrecognized attribute. + + + + + Gets a value indicating whether an unknown element is encountered during deserialization. + + + true when an unknown element is encountered while deserializing; otherwise, false. + + The name of the unknown subelement. + The being used for deserialization. + The element identified by is locked. + - or - + One or more of the element's attributes is locked. + - or - + is unrecognized, or the element has an unrecognized attribute. + - or - + The element has a Boolean attribute with an invalid value. + - or - + An attempt was made to deserialize a property more than once. + - or - + An attempt was made to deserialize a property that is not a valid member of the element. + - or - + The element cannot contain a CDATA or text element. + + + + + Write the contents of this element to the given . + + The caller of this method has already written the start element tag before + calling this method, so deriving classes only need to write the element content, not + the start or end tags. + Writer to send XML content to. + + + + Name of this parameter. + + + + + Type of this parameter. + + This is only needed in order to disambiguate method overloads. Normally + the parameter name is sufficient. + + + + Element that describes the value for this property. + + + This is NOT marked as a ConfigurationProperty because this + child element is polymorphic, and the element tag determines + the type. Standard configuration properties only let you do + this if it's a collection, but we only want one value. Thus + the separate property. The element is deserialized in + . + + + + A string describing where the value this element contains + is being used. For example, if setting a property Prop1, + this should return "property Prop1" (in english). + + + + + A collection of objects. + + + + + Gets the element key for a specified configuration element when overridden in a derived class. + + + An that acts as the key for the specified . + + The to return the key for. + + + + + A collection of objects. + + + + + Causes the configuration system to throw an exception. + + + true if the unrecognized element was deserialized successfully; otherwise, false. The default is false. + + The name of the unrecognized element. + An input stream that reads XML from the configuration file. + The element specified in is the <clear> element. + starts with the reserved prefix "config" or "lock". + + + + + When overridden in a derived class, creates a new . + + + A new . + + + + + Gets the element key for a specified configuration element when overridden in a derived class. + + + An that acts as the key for the specified . + + The to return the key for. + + + + + String that will be deserialized to provide the value. + + + + + A string describing where the value this element contains + is being used. For example, if setting a property Prop1, + this should return "property Prop1" (in english). + + + + + 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 An abstract ContainerConfiguringElement cannot be created. Please specify a concrete type.. + + + + + Looks up a localized string similar to An abstract ExtensionConfigurationElement object cannot be created. Please specify a concrete type.. + + + + + Looks up a localized string similar to An abstract InjectionMemberElement object cannot be created. Please specify a concrete type.. + + + + + Looks up a localized string similar to An abstract ParameterValueElement object cannot be created. Please specify a concrete type.. + + + + + Looks up a localized string similar to The type name or alias {0} could not be resolved. Please check your configuration file and verify this type name.. + + + + + Looks up a localized string similar to The dependency element for generic parameter {0} must not have an explicit type name but has '{1}'.. + + + + + Looks up a localized string similar to The optional dependency element for generic parameter {0} must not have an explicit type name but has '{1}'.. + + + + + Looks up a localized string similar to {0} {1}. + + + + + Looks up a localized string similar to The injection configuration for {0} has multiple values.. + + + + + Looks up a localized string similar to The configuration element type {0} has not been registered with the section.. + + + + + Looks up a localized string similar to The injection configuration for {0} is specified through both attributes and child value elements.. + + + + + Looks up a localized string similar to Could not load section extension type {0}.. + + + + + Looks up a localized string similar to The extension type {0} does not derive from SectionExtension.. + + + + + Looks up a localized string similar to The extension element type {0} that is being added does not derive from ContainerConfiguringElement, InjectionMemberElement, or ParameterValueElement. An extension element must derive from one of these types.. + + + + + Looks up a localized string similar to No valid attributes were found to construct the value for the {0}. Please check the configuration file.. + + + + + Looks up a localized string similar to Configuration is incorrect, the type {0} does not have a constructor that takes parameters named {1}.. + + + + + Looks up a localized string similar to Configuration is incorrect, the type {0} does not have a method named {1} that takes parameters named {2}.. + + + + + Looks up a localized string similar to The container named "{0}" is not defined in this configuration section.. + + + + + Looks up a localized string similar to The type {0} does not have a property named {1}.. + + + + + Looks up a localized string similar to The configuration is set to inject an array, but the type {0} is not an array type.. + + + + + Looks up a localized string similar to parameter. + + + + + Looks up a localized string similar to property. + + + + + Looks up a localized string similar to The attribute {0} must be present and non-empty.. + + + + + Looks up a localized string similar to The value element for {1} was specified for the generic array type {0}. Value elements are not allowed for generic array types.. + + + + + Looks up a localized string similar to The value element for {1} was specified for the generic parameter type {0}. Value elements are not allowed for generic parameter types.. + + + + + Looks up a localized string similar to The value element for {1} was specified for the generic type {0}. Value elements are not allowed for generic types.. + + + + + A class representing a property configuration element. + + + + + Construct a new instance of + + + + + Reads XML from the configuration file. + + The that reads from the configuration file. + true to serialize only the collection key properties; otherwise, false. + The element to read is locked. + - or - + An attribute of the current node is not recognized. + - or - + The lock status of the current node cannot be determined. + + + + + Gets a value indicating whether an unknown attribute is encountered during deserialization. + + + true when an unknown attribute is encountered while deserializing; otherwise, false. + + The name of the unrecognized attribute. + The value of the unrecognized attribute. + + + + + Gets a value indicating whether an unknown element is encountered during deserialization. + + + true when an unknown element is encountered while deserializing; otherwise, false. + + The name of the unknown subelement. + The being used for deserialization. + The element identified by is locked. + - or - + One or more of the element's attributes is locked. + - or - + is unrecognized, or the element has an unrecognized attribute. + - or - + The element has a Boolean attribute with an invalid value. + - or - + An attempt was made to deserialize a property more than once. + - or - + An attempt was made to deserialize a property that is not a valid member of the element. + - or - + The element cannot contain a CDATA or text element. + + + + + Write the contents of this element to the given . + + The caller of this method has already written the start element tag before + calling this method, so deriving classes only need to write the element content, not + the start or end tags. + Writer to send XML content to. + + + + Return the set of s that are needed + to configure the container according to this configuration element. + + Container that is being configured. + Type that is being registered. + Type that is being mapped to. + Name this registration is under. + One or more objects that should be + applied to the container registration. + + + + Name of the property that will be set. + + + + + Each element must have a unique key, which is generated by the subclasses. + + + + + String that will be deserialized to provide the value. + + + + + A string describing where the value this element contains + is being used. For example, if setting a property Prop1, + this should return "property Prop1" (in english). + + + + + Element name to use to serialize this into XML. + + + + + A configuration element representing a single container type registration. + + + + + Apply the registrations from this element to the given container. + + Container to configure. + + + + Write the contents of this element to the given . + + The caller of this method has already written the start element tag before + calling this method, so deriving classes only need to write the element content, not + the start or end tags. + Writer to send XML content to. + + + + The type that is registered. + + + + + Name registered under. + + + + + Type that is mapped to. + + + + + Lifetime manager to register for this registration. + + + + + Any injection members (constructor, properties, etc.) that are specified for + this registration. + + + + + A collection of s. + + + + + Causes the configuration system to throw an exception. + + + true if the unrecognized element was deserialized successfully; otherwise, false. The default is false. + + The name of the unrecognized element. + An input stream that reads XML from the configuration file. + The element specified in is the <clear> element. + starts with the reserved prefix "config" or "lock". + + + + + Gets the element key for a specified configuration element when overridden in a derived class. + + + An that acts as the key for the specified . + + The to return the key for. + + + + + Base class for Unity configuration section extensions. + Derived classes are used to add custom elments and aliases + into the configuration section being loaded. + + + + + Add the extensions to the section via the context. + + Context object that can be used to add elements and aliases. + + + + An object that gives the ability to add + elements and aliases to a configuration section. + + + + + Add a new alias to the configuration section. This is useful + for those extensions that add commonly used types to configuration + so users don't have to alias them repeatedly. + + The alias to use. + Type the alias maps to. + + + + Add a new alias to the configuration section. This is useful + for those extensions that add commonly used types to configuration + so users don't have to alias them repeatedly. + + Type the alias maps to. + The alias to use + + + + Add a new element to the configuration section schema. + + Tag name in the XML. + Type the tag maps to. + + + + Add a new element to the configuration section schema. + + Type the tag maps to. + Tag name in the XML. + + + + A configuration element used to specify which extensions to + add to the configuration schema. + + + + + Reads XML from the configuration file. + + The that reads from the configuration file. + true to serialize only the collection key properties; otherwise, false. + The element to read is locked. + - or - + An attribute of the current node is not recognized. + - or - + The lock status of the current node cannot be determined. + + + + + Write the contents of this element to the given . + + The caller of this method has already written the start element tag before + calling this method, so deriving classes only need to write the element content, not + the start or end tags. + Writer to send XML content to. + + + + Type of the section extender object that will provide new elements to the schema. + + + + + Optional prefix that will be added to the element names added by this + section extender. If left out, no prefix will be added. + + + + + The extension object represented by this element. + + + + + A collection of s. + + + + + Gets the element key for a specified configuration element when overridden in a derived class. + + + An that acts as the key for the specified . + + The to return the key for. + + + + + Type that manage access to a set of type aliases and implements + the logic for converting aliases to their actual types. + + + + + Set the set of aliases to use for resolution. + + Configuration section containing the various + type aliases, namespaces and assemblies. + + + + Resolves a type alias or type fullname to a concrete type. + + Type alias or type fullname + Type object or null if resolve fails. + Thrown if alias lookup fails. + + + + Resolves a type alias or type fullname to a concrete type. + + Alias or name to resolve. + if true and the alias does not + resolve, throw an , otherwise + return null on failure. + The type object or null if resolve fails and + is false. + + + + Resolve a type alias or type full name to a concrete type. + If is null or empty, return the + given instead. + + Type alias or full name to resolve. + Value to return if typeName is null or empty. + The concrete . + Thrown if alias lookup fails. + + + + Resolve a type alias or type full name to a concrete type. + If is null or empty, return the + given instead. + + Type alias or full name to resolve. + Value to return if typeName is null or empty. + if true and the alias does not + resolve, throw an , otherwise + return null on failure. + The concrete . + Thrown if alias lookup fails and + is true. + + + + A helper class that implements the actual logic for resolving a shorthand + type name (alias or raw type name) into an actual type object. + + + + + Construct a new that uses the given + sequence of alias, typename pairs to resolve types. + + Type aliases from the configuration file. + Assembly names to search. + Namespaces to search. + + + + Resolves a type alias or type fullname to a concrete type. + + Alias or name to resolve. + if true and the alias does not + resolve, throw an , otherwise + return null on failure. + The type object or null if resolve fails and + is false. + + + + Resolve a type alias or type full name to a concrete type. + If is null or empty, return the + given instead. + + Type alias or full name to resolve. + Value to return if typeName is null or empty. + if true and the alias does not + resolve, throw an , otherwise + return null on failure. + + If is null or an empty string, + then return . + Otherwise, return the resolved type object. If the resolution fails + and is false, then return null. + + + + + A configuration section describing configuration for an . + + + + + The name of the section where unity configuration is expected to be found. + + + + + XML Namespace string used for IntelliSense in this section. + + + + + Apply the configuration in the default container element to the given container. + + Container to configure. + The passed in . + + + + Apply the configuration in the default container element to the given container. + + Container to configure. + Name of the container element to use to configure the container. + The passed in . + + + + Reads XML from the configuration file. + + The object, which reads from the configuration file. + found no elements in the configuration file. + + + + + Gets a value indicating whether an unknown element is encountered during deserialization. + + + true when an unknown element is encountered while deserializing; otherwise, false. + + The name of the unknown subelement. + The being used for deserialization. + The element identified by is locked. + - or - + One or more of the element's attributes is locked. + - or - + is unrecognized, or the element has an unrecognized attribute. + - or - + The element has a Boolean attribute with an invalid value. + - or - + An attempt was made to deserialize a property more than once. + - or - + An attempt was made to deserialize a property that is not a valid member of the element. + - or - + The element cannot contain a CDATA or text element. + + + + + Creates an XML string containing an unmerged view of the object as a single section to write to a file. + + + An XML string containing an unmerged view of the object. + + The instance to use as the parent when performing the un-merge. + The name of the section to create. + The instance to use when writing to a string. + + + + + The current that is being deserialized + or being configured from. + + + + + Storage for XML namespace. The namespace isn't used or validated by config, but + it is useful for Visual Studio XML IntelliSense to kick in. + + + + + The set of containers defined in this configuration section. + + + + + The set of type aliases defined in this configuration file. + + + + + Any schema extensions that are added. + + + + + Any namespaces added to the type search list. + + + + + Any assemblies added to the type search list. + + + + + Add a new alias to the configuration section. This is useful + for those extensions that add commonly used types to configuration + so users don't have to alias them repeatedly. + + The alias to use. + Type the alias maps to. + + + + Add a new element to the configuration section schema. + + Tag name in the XML. + Type the tag maps to. + + + + Collection element for s. + + + + + Plug point to get objects out of the collection. + + Index in the collection to retrieve the item from. + Item at that index or null if not present. + + + + Plug point to get objects out of the collection. + + Key to look up the object by. + Item with that key or null if not present. + + + + Gets the element key for a specified configuration element when overridden in a derived class. + + + An that acts as the key for the specified . + + The to return the key for. + + + + + Retrieve a stored by name. + + Name to look up. + The stored container or null if not in the collection. + + + + Return the default container in the collection. The default is the one without a name. + + + + + Extensions to to simplify + loading configuration into a container. + + + + + Apply configuration from the given section and named container + into the given container. + + Unity container to configure. + Configuration section with config information. + Named container. + . + + + + Apply configuration from the default section (named "unity" pulled out of + ConfigurationManager) and the named container. + + Unity container to configure. + Named container element in configuration. + . + + + + Apply configuration from the default section and unnamed container element. + + Container to configure. + . + + + + Apply configuration from the default container in the given section. + + Unity container to configure. + Configuration section. + . + + + + Element that describes a constant value that will be + injected into the container. + + + + + Construct a new object. + + + + + Construct a new object, + initializing properties from the contents of + . + + Name/value pairs which + contain the values to initialize properties to. + + + + Write the contents of this element to the given . + + The caller of this method has already written the start element tag before + calling this method, so deriving classes only need to write the element content, not + the start or end tags. + Writer to send XML content to. + + + + Write the contents of this element to the given . This + method always outputs an explicit <dependency> tag, instead of providing + attributes to the parent method. + + Writer to send XML content to. + + + + Generate an object + that will be used to configure the container for a type registration. + + Container that is being configured. Supplied in order + to let custom implementations retrieve services; do not configure the container + directly in this method. + Type of the parameter to get the value for. + The required object. + + + + Value for this element + + + + + + + + + diff -r 000000000000 -r 5bca2d201ad8 src/packages/Unity.3.0.1304.1/lib/Net45/Microsoft.Practices.Unity.dll Binary file src/packages/Unity.3.0.1304.1/lib/Net45/Microsoft.Practices.Unity.dll has changed diff -r 000000000000 -r 5bca2d201ad8 src/packages/Unity.3.0.1304.1/lib/Net45/Microsoft.Practices.Unity.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/packages/Unity.3.0.1304.1/lib/Net45/Microsoft.Practices.Unity.xml Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,6179 @@ + + + + Microsoft.Practices.Unity + + + + + The exception that is thrown when registering multiple types would result in an type mapping being overwritten. + + + + + Initializes a new instance of the class. + + The name for the mapping. + The source type for the mapping. + The type currently mapped. + The new type to map. + + + + Gets the name for the mapping. + + + + + Gets the source type for the mapping. + + + + + Gets the type currently mapped. + + + + + Gets the new type to map. + + + + + Provides helper methods to specify the lifetime for a type with registration by convention. + + + + + Returns a . + + The type. + A lifetime manager + + + + Returns a . + + The type. + A container controlled lifetime manager. + + + + Returns a . + + The type. + An externally controlled lifetime manager. + + + + Returns a . + + The type. + A hierarchical lifetime manager. + + + + Returns a . + + The type. + A per resolve lifetime manager. + + + + Returns a . + + The type. + A transient lifetime manager. + + + + Returns a . + + The custom type. + The type. + + A lifetime manager. + + + + + Returns a . + + The type. + A per thread lifetime manager. + + + + Provides helper methods to retrieve classes from assemblies. + + + + + Returns all visible, non-abstract classes from . + + The assemblies. + All visible, non-abstract classes found in the assemblies. + is . + contains elements. + All exceptions thrown while getting types from the assemblies are ignored, and the types that can be retrieved are returned. + + + + Returns all visible, non-abstract classes from , and optionally skips errors. + + to skip errors; otherwise, . + The assemblies. + + All visible, non-abstract classes. + + is . + contains elements. + + If is , all exceptions thrown while getting types from the assemblies are ignored, and the types + that can be retrieved are returned; otherwise, the original exception is thrown. + + + + + Returns all visible, non-abstract classes from . + + to skip errors; otherwise, . + The assemblies. + + All visible, non-abstract classes. + + is . + contains elements. + + If is , all exceptions thrown while getting types from the assemblies are ignored, and the types + that can be retrieved are returned; otherwise, the original exception is thrown. + + + + + Returns all visible, non-abstract classes from all assemblies that are loaded in the current application domain. + + to include system assemblies; otherwise, . Defaults to . + to include the Unity assemblies; otherwise, . Defaults to . + to include dynamic assemblies; otherwise, . Defaults to . + to skip errors; otherwise, . + + All visible, non-abstract classes in the loaded assemblies. + + + If is , all exceptions thrown while getting types from the assemblies are ignored, and the types + that can be retrieved are returned; otherwise, the original exception is thrown. + + + + + Returns all visible, non-abstract classes from all assemblies that are located in the base folder of the current application domain. + + to include system assemblies; otherwise, . Defaults to . + to include the Unity assemblies; otherwise, . Defaults to . + to skip errors; otherwise, . + + All visible, non-abstract classes. + + + If is , all exceptions thrown while loading assemblies or getting types from the assemblies are ignored, and the types + that can be retrieved are returned; otherwise, the original exception is thrown. + + + + + Represents a set of types to register and their registration settings. + + + + + Gets types to register. + + + + + Gets a function to get the types that will be requested for each type to configure. + + + + + Gets a function to get the name to use for the registration of each type. + + + + + Gets a function to get the for the registration of each type. Defaults to no lifetime management. + + + + + + Gets a function to get the additional objects for the registration of each type. Defaults to no injection members. + + + + + + Provides helper methods to get type names. + + + + + Returns the type name. + + The type. + The type name. + + + + Returns null for the registration name. + + The type. + + + + + Provides helper methods to map types to the types interfaces to which register them. + + + + + Returns no types. + + The type to register. + An empty enumeration. + + + + Returns an enumeration with the interface that matches the name of . + + The type to register. + An enumeration with the first interface matching the name of (for example, if type is MyType, a matching interface is IMyType), + or an empty enumeration if no such interface is found. + + + + Returns an enumeration with all the interfaces implemented by . + + The type to register. + An enumeration with all the interfaces implemented by the implementation type except . + + + + Returns an enumeration with all the interfaces implemented by that belong to the same assembly as implementationType. + + The type to register. + An enumeration with all the interfaces implemented by the implementation type that belong to the same assembly. + + + + Provides a set of convenience overloads to the + interface to support registration of multiple types. + + + + + Registers the supplied types by using the specified rules for name, lifetime manager, injection members, and registration types. + + The container to configure. + The types to register. The methods in the class can be used to scan assemblies to get types, and further filtering can be performed using LINQ queries. + A function that gets the types that will be requested for each type to configure. It can be a method from the class or a custom function. Defaults to no registration types, and registers only the supplied types. + A function that gets the name to use for the registration of each type. It can be a method from the or a custom function. Defaults to no name. + A function that gets the for the registration of each type. It can be a method from the class or a custom function. Defaults to no lifetime management. + A function that gets the additional objects for the registration of each type. Defaults to no injection members. + to overwrite existing mappings; otherwise, . Defaults to . + + The container that this method was called on. + + A new registration would overwrite an existing mapping and is . + + + + Registers the types according to the . + + The container to configure. + The convention to determine which types will be registered and how. + to overwrite existing mappings; otherwise, . Defaults to . + + The container that this method was called on. + + + + + An implementation + that constructs a build plan for creating objects. + + + + + A that can create and return an + for the given build key. + + + + + Represents a builder policy interface. Since there are no fixed requirements + for policies, it acts as a marker interface from which to derive all other + policy interfaces. + + + + + Create a build plan using the given context and build key. + + Current build context. + Current build key. + The build plan. + + + + Creates a build plan using the given context and build key. + + Current build context. + Current build key. + + The build plan. + + + + + Provides extension methods to the class due to the introduction + of class in the .NET for Windows Store apps. + + + + + Returns the constructor in that matches the specified constructor parameter types. + + The type to inspect + The constructor parameter types. + The constructor that matches the specified parameter types. + + + + Returns the non-static declared methods of a type or its base types. + + The type to inspect + An enumerable of the objects. + + + + Returns the non-static method of a type or its based type. + + The type to inspect + The name of the method to seek. + The (closed) parameter type signature of the method. + The discovered + + + + Returns the declared properties of a type or its base types. + + The type to inspect + An enumerable of the objects. + + + + Determines if the types in a parameter set ordinally matches the set of supplied types. + + + + + + + + Base class for attributes that can be placed on parameters + or properties to specify how to resolve the value for + that parameter or property. + + + + + Create an instance of that + will be used to get the value for the member this attribute is + applied to. + + Type of parameter or property that + this attribute is decoration. + The resolver object. + + + + This attribute is used to indicate which constructor to choose when + the container attempts to build a type. + + + + + This attribute is used to mark methods that should be called when + the container is building an object. + + + + + This attribute is used to mark properties and parameters as targets for injection. + + + For properties, this attribute is necessary for injection to happen. For parameters, + it's not needed unless you want to specify additional information to control how + the parameter is resolved. + + + + + Create an instance of with no name. + + + + + Create an instance of with the given name. + + Name to use when resolving this dependency. + + + + Create an instance of that + will be used to get the value for the member this attribute is + applied to. + + Type of parameter or property that + this attribute is decoration. + The resolver object. + + + + The name specified in the constructor. + + + + + An used to mark a dependency + as optional - the container will try to resolve it, and return null + if the resolution fails rather than throw. + + + + + Construct a new object. + + + + + Construct a new object that + specifies a named dependency. + + Name of the dependency. + + + + Create an instance of that + will be used to get the value for the member this attribute is + applied to. + + Type of parameter or property that + this attribute is decoration. + The resolver object. + + + + Name of the dependency. + + + + + A that composites other + ResolverOverride objects. The GetResolver operation then + returns the resolver from the first child override that + matches the current context and request. + + + + + Base class for all override objects passed in the + method. + + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + Wrap this resolver in one that verifies the type of the object being built. + This allows you to narrow any override down to a specific type easily. + + Type to constrain the override to. + The new override. + + + + Wrap this resolver in one that verifies the type of the object being built. + This allows you to narrow any override down to a specific type easily. + + Type to constrain the override to. + The new override. + + + + Add a new to the collection + that is checked. + + item to add. + + + + Add a setof s to the collection. + + items to add. + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + 2 + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + 1 + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + Class that returns information about the types registered in a container. + + + + + The type that was passed to the method + as the "from" type, or the only type if type mapping wasn't done. + + + + + The type that this registration is mapped to. If no type mapping was done, the + property and this one will have the same value. + + + + + Name the type was registered under. Null for default registration. + + + + + The registered lifetime manager instance. + + + + + The lifetime manager for this registration. + + + This property will be null if this registration is for an open generic. + + + + A class that overrides + the value injected whenever there is a dependency of the + given type, regardless of where it appears in the object graph. + + + + + Create an instance of to override + the given type with the given value. + + Type of the dependency. + Value to use. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + A convenience version of that lets you + specify the dependency type using generic syntax. + + Type of the dependency to override. + + + + Construct a new object that will + override the given dependency, and pass the given value. + + + + + A convenience form of that lets you + specify multiple parameter overrides in one shot rather than having + to construct multiple objects. + + + This class isn't really a collection, it just implements IEnumerable + so that we get use of the nice C# collection initializer syntax. + + + + + Base helper class for creating collections of objects + for use in passing a bunch of them to the resolve call. This base class provides + the mechanics needed to allow you to use the C# collection initializer syntax. + + Concrete type of the this class collects. + Key used to create the underlying override object. + Value that the override returns. + + + + Add a new override to the collection with the given key and value. + + Key - for example, a parameter or property name. + Value - the value to be returned by the override. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + 2 + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + 1 + + + + When implemented in derived classes, this method is called from the + method to create the actual objects. + + Key value to create the resolver. + Value to store in the resolver. + The created . + + + + When implemented in derived classes, this method is called from the + method to create the actual objects. + + Key value to create the resolver. + Value to store in the resolver. + The created . + + + + Event argument class for the event. + + + + + Construct a new object with the + given child container object. + + An for the newly created child + container. + + + + The newly created child container. + + + + + An extension context for the created child container. + + + + + Base class for subclasses that let you specify that + an instance of a generic type parameter should be resolved. + + + + + Base type for objects that are used to configure parameters for + constructor or method injection, or for getting the value to + be injected into a property. + + + + + Test to see if this parameter value has a matching type for the given type. + + Type to check. + True if this parameter value is compatible with type , + false if not. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + Convert the given set of arbitrary values to a sequence of InjectionParameterValue + objects. The rules are: If it's already an InjectionParameterValue, return it. If + it's a Type, return a ResolvedParameter object for that type. Otherwise return + an InjectionParameter object for that value. + + The values to build the sequence from. + The resulting converted sequence. + + + + Convert an arbitrary value to an InjectionParameterValue object. The rules are: + If it's already an InjectionParameterValue, return it. If it's a Type, return a + ResolvedParameter object for that type. Otherwise return an InjectionParameter + object for that value. + + The value to convert. + The resulting . + + + + Name for the type represented by this . + This may be an actual type name or a generic argument name. + + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + name to use when looking up in the container. + + + + Test to see if this parameter value has a matching type for the given type. + + Type to check. + True if this parameter value is compatible with type , + false if not. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + Return a instance that will + return this types value for the parameter. + + The actual type to resolve. + The resolution key. + The . + + + + Name for the type represented by this . + This may be an actual type name or a generic argument name. + + + + + A that lets you specify that + an instance of a generic type parameter should be resolved, providing the + value if resolving fails. + + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + name to use when looking up in the container. + + + + Return a instance that will + return this types value for the parameter. + + The actual type to resolve. + The resolution key. + The . + + + + A class that lets you specify a factory method the container + will use to create the object. + + This is a significantly easier way to do the same + thing the old static factory extension was used for. + + + + Base class for objects that can be used to configure what + class members get injected by the container. + + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Type to register. + Policy list to add policies to. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Type of interface being registered. If no interface, + this will be null. + Type of concrete type being registered. + Name used to resolve the type object. + Policy list to add policies to. + + + + Create a new instance of with + the given factory function. + + Factory function. + + + + Create a new instance of with + the given factory function. + + Factory function. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Type of interface being registered. If no interface, + this will be null. This parameter is ignored in this implementation. + Type of concrete type being registered. + Name used to resolve the type object. + Policy list to add policies to. + + + + A that can be passed to + to configure a + parameter or property as an optional dependency. + + + + + A base class for implementing classes + that deal in explicit types. + + + + + Create a new that exposes + information about the given . + + Type of the parameter. + + + + Test to see if this parameter value has a matching type for the given type. + + Type to check. + True if this parameter value is compatible with type , + false if not. + + + + The type of parameter this object represents. + + + + + Name for the type represented by this . + This may be an actual type name or a generic argument name. + + + + + Construct a new object that + specifies the given . + + Type of the dependency. + + + + Construct a new object that + specifies the given and . + + Type of the dependency. + Name for the dependency. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + A generic version of that lets you + specify the type of the dependency using generics syntax. + + Type of the dependency. + + + + Construct a new . + + + + + Construct a new with the given + . + + Name of the dependency. + + + + A special lifetime manager which works like , + except that in the presence of child containers, each child gets it's own instance + of the object, instead of sharing one in the common parent. + + + + + A that holds onto the instance given to it. + When the is disposed, + the instance is disposed with it. + + + + + Base class for Lifetime managers which need to synchronize calls to + . + + + + The purpose of this class is to provide a basic implementation of the lifetime manager synchronization pattern. + + + Calls to the method of a + instance acquire a lock, and if the instance has not been initialized with a value yet the lock will only be released + when such an initialization takes place by calling the method or if + the build request which resulted in the call to the GetValue method fails. + + + + + + + Base class for Lifetime managers - classes that control how + and when instances are created by the Unity container. + + + + + A that controls how instances are + persisted and recovered from an external store. Used to implement + things like singletons and per-http-request lifetime. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object to store. + + + + Remove the value this lifetime policy is managing from backing store. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + + + + Remove the given object from backing store. + + + + + This interface provides a hook for the builder context to + implement error recovery when a builder strategy throws + an exception. Since we can't get try/finally blocks onto + the call stack for later stages in the chain, we instead + add these objects to the context. If there's an exception, + all the current IRequiresRecovery instances will have + their Recover methods called. + + + + + A method that does whatever is needed to clean up + as part of cleaning up after an exception. + + + Don't do anything that could throw in this method, + it will cause later recover operations to get skipped + and play real havoc with the stack trace. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + Calls to this method acquire a lock which is released only if a non-null value + has been set for the lifetime manager. + + + + Performs the actual retrieval of a value from the backing store associated + with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + This method is invoked by + after it has acquired its lock. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + Setting a value will attempt to release the lock acquired by + . + + + + Performs the actual storage of the given value into backing store for retrieval later. + + The object being stored. + This method is invoked by + before releasing its lock. + + + + Remove the given object from backing store. + + + + + A method that does whatever is needed to clean up + as part of cleaning up after an exception. + + + Don't do anything that could throw in this method, + it will cause later recover operations to get skipped + and play real havoc with the stack trace. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + + + + Remove the given object from backing store. + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + 2 + + + + Standard Dispose pattern implementation. Not needed, but it keeps FxCop happy. + + Always true, since we don't have a finalizer. + + + + This is a custom lifetime manager that acts like , + but also provides a signal to the default build plan, marking the type so that + instances are reused across the build up object graph. + + + + + Construct a new object that does not + itself manage an instance. + + + + + Construct a new object that stores the + give value. This value will be returned by + but is not stored in the lifetime manager, nor is the value disposed. + This Lifetime manager is intended only for internal use, which is why the + normal method is not used here. + + Value to store. + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. In this class, + this is a noop, since it has special hooks down in the guts. + + The object being stored. + + + + Remove the given object from backing store. Noop in this class. + + + + + A strategy that handles Hierarchical lifetimes across a set of parent/child + containers. + + + + + Represents a strategy in the chain of responsibility. + Strategies are required to support both BuildUp and TearDown. + + + + + Represents a strategy in the chain of responsibility. + Strategies are required to support both BuildUp and TearDown. Although you + can implement this interface directly, you may also choose to use + as the base class for your strategies, as + this class provides useful helper methods and makes support BuildUp and TearDown + optional. + + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + Called during the chain of responsibility for a build operation. The + PostBuildUp method is called when the chain has finished the PreBuildUp + phase and executes in reverse order from the PreBuildUp calls. + + Context of the build operation. + + + + Called during the chain of responsibility for a teardown operation. The + PreTearDown method is called when the chain is being executed in the + forward direction. + + Context of the teardown operation. + + + + Called during the chain of responsibility for a teardown operation. The + PostTearDown method is called when the chain has finished the PreTearDown + phase and executes in reverse order from the PreTearDown calls. + + Context of the teardown operation. + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + Called during the chain of responsibility for a build operation. The + PostBuildUp method is called when the chain has finished the PreBuildUp + phase and executes in reverse order from the PreBuildUp calls. + + Context of the build operation. + + + + Called during the chain of responsibility for a teardown operation. The + PreTearDown method is called when the chain is being executed in the + forward direction. + + Context of the teardown operation. + + + + Called during the chain of responsibility for a teardown operation. The + PostTearDown method is called when the chain has finished the PreTearDown + phase and executes in reverse order from the PreTearDown calls. + + Context of the teardown operation. + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + A that will attempt to + resolve a value, and return null if it cannot rather than throwing. + + + + + A that is used at build plan execution time + to resolve a dependent value. + + + + + Get the value for a dependency. + + Current build context. + The value for the dependency. + + + + Construct a new object + that will attempt to resolve the given name and type from the container. + + Type to resolve. Must be a reference type. + Name to resolve with. + + + + Construct a new object + that will attempt to resolve the given type from the container. + + Type to resolve. Must be a reference type. + + + + Get the value for a dependency. + + Current build context. + The value for the dependency. + + + + Type this resolver will resolve. + + + + + Name this resolver will resolve. + + + + + Extension methods on to provide convenience + overloads (generic versions, mostly). + + + + + Removes an individual policy type for a build key. + + The type the policy was registered as. + to remove the policy from. + The key the policy applies. + + + + Removes a default policy. + + The type the policy was registered as. + to remove the policy from. + + + + Gets an individual policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + The policy list that actually contains the returned policy. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + to search. + The interface the policy is registered under. + The key the policy applies. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + to search. + The interface the policy is registered under. + The key the policy applies. + The policy list that actually contains the returned policy. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy list that actually contains the returned policy. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + to search. + The interface the policy is registered under. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy list that actually contains the returned policy. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + to search. + The interface the policy is registered under. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy in the list, if present; returns null otherwise. + + + + Sets an individual policy. + + The interface the policy is registered under. + to add the policy to. + The policy to be registered. + The key the policy applies. + + + + Sets a default policy. When checking for a policy, if no specific individual policy + is available, the default will be used. + + The interface to register the policy under. + to add the policy to. + The default policy to be registered. + + + + Base class for the current operation stored in the build context. + + + + + Create a new . + + Type currently being built. + + + + The type that's currently being built. + + + + + Build plan for that will + return a func that will resolve the requested type + through this container later. + + + + + A build plan is an object that, when invoked, will create a new object + or fill in a given existing one. It encapsulates all the information + gathered by the strategies to construct a particular object. + + + + + Creates an instance of this build plan's type, or fills + in the existing type if passed in. + + Context used to build up the object. + + + + Creates an instance of this build plan's type, or fills + in the existing type if passed in. + + Context used to build up the object. + + + + The almost inevitable collection of extra helper methods on + to augment the rich set of what + Linq already gives us. + + + + + Execute the provided on every item in . + + Type of the items stored in + Sequence of items to process. + Code to run over each item. + + + + Create a single string from a sequenc of items, separated by the provided , + and with the conversion to string done by the given . + + This method does basically the same thing as , + but will work on any sequence of items, not just arrays. + Type of items in the sequence. + Sequence of items to convert. + Separator to place between the items in the string. + The conversion function to change TItem -> string. + The resulting string. + + + + Create a single string from a sequenc of items, separated by the provided , + and with the conversion to string done by the item's method. + + This method does basically the same thing as , + but will work on any sequence of items, not just arrays. + Type of items in the sequence. + Sequence of items to convert. + Separator to place between the items in the string. + The resulting string. + + + + A class that lets you + override a named parameter passed to a constructor. + + + + + Construct a new object that will + override the given named constructor parameter, and pass the given + value. + + Name of the constructor parameter. + Value to pass for the constructor. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + A convenience form of that lets you + specify multiple parameter overrides in one shot rather than having + to construct multiple objects. + + + + + When implemented in derived classes, this method is called from the + method to create the actual objects. + + Key value to create the resolver. + Value to store in the resolver. + The created . + + + + A that lets you override + the value for a specified property. + + + + + Create an instance of . + + The property name. + Value to use for the property. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + A convenience form of that lets you + specify multiple property overrides in one shot rather than having + to construct multiple objects. + + + + + When implemented in derived classes, this method is called from the + method to create the actual objects. + + Key value to create the resolver. + Value to store in the resolver. + The created . + + + + Interface defining the configuration interface exposed by the + Static Factory extension. + + + + + Base interface for all extension configuration interfaces. + + + + + Retrieve the container instance that we are currently configuring. + + + + + Register the given factory delegate to be called when the container is + asked to resolve . + + Type that will be requested from the container. + Delegate to invoke to create the instance. + The container extension object this method was invoked on. + + + + Register the given factory delegate to be called when the container is + asked to resolve and . + + Type that will be requested from the container. + The name that will be used when requesting to resolve this type. + Delegate to invoke to create the instance. + The container extension object this method was invoked on. + + + + Represents the context in which a build-up or tear-down operation runs. + + + + + Represents the context in which a build-up or tear-down operation runs. + + + + + Add a new set of resolver override objects to the current build operation. + + objects to add. + + + + Get a object for the given + or null if that dependency hasn't been overridden. + + Type of the dependency. + Resolver to use, or null if no override matches for the current operation. + + + + A convenience method to do a new buildup operation on an existing context. + + Key to use to build up. + Created object. + + + + A convenience method to do a new buildup operation on an existing context. This + overload allows you to specify extra policies which will be in effect for the duration + of the build. + + Key defining what to build up. + A delegate that takes a . This + is invoked with the new child context before the build up process starts. This gives callers + the opportunity to customize the context for the build process. + Created object. + + + + Gets the head of the strategy chain. + + + The strategy that's first in the chain; returns null if there are no + strategies in the chain. + + + + + Gets the associated with the build. + + + The associated with the build. + + + + + Gets the original build key for the build operation. + + + The original build key for the build operation. + + + + + Get the current build key for the current build operation. + + + + + The set of policies that were passed into this context. + + This returns the policies passed into the context. + Policies added here will remain after buildup completes. + The persistent policies for the current context. + + + + Gets the policies for the current context. + + Any policies added to this object are transient + and will be erased at the end of the buildup. + + The policies for the current context. + + + + + Gets the collection of objects + that need to execute in event of an exception. + + + + + The current object being built up or torn down. + + + The current object being manipulated by the build operation. May + be null if the object hasn't been created yet. + + + + Flag indicating if the build operation should continue. + + true means that building should not call any more + strategies, false means continue to the next strategy. + + + + An object representing what is currently being done in the + build chain. Used to report back errors if there's a failure. + + + + + The build context used to resolve a dependency during the build operation represented by this context. + + + + + Initialize a new instance of the class. + + + + + Initialize a new instance of the class with a , + , and the + build key used to start this build operation. + + The to use for this context. + The to use for this context. + The to use for this context. + Build key to start building. + The existing object to build up. + + + + Create a new using the explicitly provided + values. + + The to use for this context. + The to use for this context. + The set of persistent policies to use for this context. + The set of transient policies to use for this context. It is + the caller's responsibility to ensure that the transient and persistent policies are properly + combined. + Build key for this context. + Existing object to build up. + + + + Add a new set of resolver override objects to the current build operation. + + objects to add. + + + + Get a object for the given + or null if that dependency hasn't been overridden. + + Type of the dependency. + Resolver to use, or null if no override matches for the current operation. + + + + A convenience method to do a new buildup operation on an existing context. + + Key to use to build up. + Created object. + + + + A convenience method to do a new buildup operation on an existing context. This + overload allows you to specify extra policies which will be in effect for the duration + of the build. + + Key defining what to build up. + A delegate that takes a . This + is invoked with the new child context before the build up process starts. This gives callers + the opportunity to customize the context for the build process. + Created object. + + + + Gets the head of the strategy chain. + + + The strategy that's first in the chain; returns null if there are no + strategies in the chain. + + + + + Get the current build key for the current build operation. + + + + + The current object being built up or torn down. + + + The current object being manipulated by the build operation. May + be null if the object hasn't been created yet. + + + + Gets the associated with the build. + + + The associated with the build. + + + + + Gets the original build key for the build operation. + + + The original build key for the build operation. + + + + + The set of policies that were passed into this context. + + This returns the policies passed into the context. + Policies added here will remain after buildup completes. + The persistent policies for the current context. + + + + Gets the policies for the current context. + + + Any modifications will be transient (meaning, they will be forgotten when + the outer BuildUp for this context is finished executing). + + + The policies for the current context. + + + + + Gets the collection of objects + that need to execute in event of an exception. + + + + + Flag indicating if the build operation should continue. + + true means that building should not call any more + strategies, false means continue to the next strategy. + + + + An object representing what is currently being done in the + build chain. Used to report back errors if there's a failure. + + + + + The build context used to resolve a dependency during the build operation represented by this context. + + + + + Represents that a dependency could not be resolved. + + + Represents that a dependency could not be resolved. + + + + + Initializes a new instance of the class with no extra information. + + + + + Initializes a new instance of the class with the given message. + + Some random message. + + + + Initialize a new instance of the class with the given + message and inner exception. + + Some random message + Inner exception. + + + + Initializes a new instance of the class with the build key of the object begin built. + + The build key of the object begin built. + + + + Initializes a new instance of the class with serialized data. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + + + The exception thrown when injection is attempted on a method + that is an open generic or has out or ref params. + + + The exception thrown when injection is attempted on a method + that is an open generic or has out or ref params. + + + + + Construct a new with no + message. + + + + + Construct a with the given message + + Message to return. + + + + Construct a with the given message + and inner exception. + + Message to return. + Inner exception + + + + Used for serialization. + + Serialization info. + Serialization context. + + + + Extension methods to provide convenience overloads over the + interface. + + + + + Start a recursive build up operation to retrieve the default + value for the given type. + + Type of object to build. + Parent context. + Resulting object. + + + + Start a recursive build up operation to retrieve the named + implementation for the given type. + + Type to resolve. + Parent context. + Name to resolve with. + The resulting object. + + + + Add a set of s to the context, specified as a + variable argument list. + + Context to add overrides to. + The overrides. + + + + Data structure that stores the set of + objects and executes them when requested. + + + + + Add a new object to this + list. + + Object to add. + + + + Execute the method + of everything in the recovery list. Recoveries will execute + in the opposite order of add - it's a stack. + + + + + Return the number of recovery objects currently in the stack. + + + + + Represents a lifetime container. + + + A lifetime container tracks the lifetime of an object, and implements + IDisposable. When the container is disposed, any objects in the + container which implement IDisposable are also disposed. + + + + + Adds an object to the lifetime container. + + The item to be added to the lifetime container. + + + + Determine if a given object is in the lifetime container. + + + The item to locate in the lifetime container. + + + Returns true if the object is contained in the lifetime + container; returns false otherwise. + + + + + Removes an item from the lifetime container. The item is + not disposed. + + The item to be removed. + + + + Gets the number of references in the lifetime container + + + The number of references in the lifetime container + + + + + Represents a lifetime container. + + + A lifetime container tracks the lifetime of an object, and implements + IDisposable. When the container is disposed, any objects in the + container which implement IDisposable are also disposed. + + + + + Adds an object to the lifetime container. + + The item to be added to the lifetime container. + + + + Determine if a given object is in the lifetime container. + + + The item to locate in the lifetime container. + + + Returns true if the object is contained in the lifetime + container; returns false otherwise. + + + + + Releases the resources used by the . + + + + + Releases the managed resources used by the DbDataReader and optionally releases the unmanaged resources. + + + true to release managed and unmanaged resources; false to release only unmanaged resources. + + + + + Returns an enumerator that iterates through the lifetime container. + + + An object that can be used to iterate through the life time container. + + + + + Returns an enumerator that iterates through the lifetime container. + + + An object that can be used to iterate through the life time container. + + + + + Removes an item from the lifetime container. The item is + not disposed. + + The item to be removed. + + + + Gets the number of references in the lifetime container + + + The number of references in the lifetime container + + + + + A custom collection over objects. + + + + + Removes an individual policy type for a build key. + + The type of policy to remove. + The key the policy applies. + + + + Removes all policies from the list. + + + + + Removes a default policy. + + The type the policy was registered as. + + + + Gets an individual policy. + + The interface the policy is registered under. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy list in the chain that the searched for policy was found in, null if the policy was + not found. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + The interface the policy is registered under. + The key the policy applies to. + True if the search should be in the local policy list only; otherwise false to search up the parent chain. + The policy list in the chain that the searched for policy was found in, null if the policy was + not found. + The policy in the list if present; returns null otherwise. + + + + Sets an individual policy. + + The of the policy. + The policy to be registered. + The key the policy applies. + + + + Sets a default policy. When checking for a policy, if no specific individual policy + is available, the default will be used. + + The interface to register the policy under. + The default policy to be registered. + + + + A custom collection wrapper over objects. + + + + + Initialize a new instance of a class. + + + + + Initialize a new instance of a class with another policy list. + + An inner policy list to search. + + + + Removes an individual policy type for a build key. + + The type of policy to remove. + The key the policy applies. + + + + Removes all policies from the list. + + + + + Removes a default policy. + + The type the policy was registered as. + + + + Gets an individual policy. + + The interface the policy is registered under. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy list in the chain that the searched for policy was found in, null if the policy was + not found. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + The interface the policy is registered under. + The key the policy applies to. + True if the search should be in the local policy list only; otherwise false to search up the parent chain. + The policy list in the chain that the searched for policy was found in, null if the policy was + not found. + The policy in the list if present; returns null otherwise. + + + + Sets an individual policy. + + The of the policy. + The policy to be registered. + The key the policy applies. + + + + Sets a default policy. When checking for a policy, if no specific individual policy + is available, the default will be used. + + The interface to register the policy under. + The default policy to be registered. + + + + Gets the number of items in the locator. + + + The number of items in the locator. + + + + + An implementation of . + + + + + Add a new object to this + list. + + Object to add. + + + + Execute the method + of everything in the recovery list. Recoveries will execute + in the opposite order of add - it's a stack. + + + + + Return the number of recovery objects currently in the stack. + + + + + Implementation of which will notify an object about + the completion of a BuildUp operation, or start of a TearDown operation. + + + This strategy checks the object that is passing through the builder chain to see if it + implements IBuilderAware and if it does, it will call + and . This strategy is meant to be used from the + stage. + + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + Called during the chain of responsibility for a teardown operation. The + PreTearDown method is called when the chain is being executed in the + forward direction. + + Context of the teardown operation. + + + + Implemented on a class when it wants to receive notifications + about the build process. + + + + + Called by the when the object is being built up. + + The key of the object that was just built up. + + + + Called by the when the object is being torn down. + + + + + Enumeration to represent the object builder stages. + + + The order of the values in the enumeration is the order in which the stages are run. + + + + + Strategies in this stage run before creation. Typical work done in this stage might + include strategies that use reflection to set policies into the context that other + strategies would later use. + + + + + Strategies in this stage create objects. Typically you will only have a single policy-driven + creation strategy in this stage. + + + + + Strategies in this stage work on created objects. Typical work done in this stage might + include setter injection and method calls. + + + + + Strategies in this stage work on objects that are already initialized. Typical work done in + this stage might include looking to see if the object implements some notification interface + to discover when its initialization stage has been completed. + + + + + Represents a builder policy for mapping build keys. + + + + + Represents a builder policy for mapping build keys. + + + + + Maps the build key. + + The build key to map. + Current build context. Used for contextual information + if writing a more sophisticated mapping. This parameter can be null + (called when getting container registrations). + The new build key. + + + + Initialize a new instance of the with the new build key. + + The new build key. + + + + Maps the build key. + + The build key to map. + Current build context. Used for contextual information + if writing a more sophisticated mapping, unused in this implementation. + The new build key. + + + + Represents a strategy for mapping build keys in the build up operation. + + + + + Called during the chain of responsibility for a build operation. Looks for the + and if found maps the build key for the current operation. + + The context for the operation. + + + + An implementation of that can map + generic types. + + + + + Create a new instance + that will map generic types. + + Build key to map to. This must be or contain an open generic type. + + + + Maps the build key. + + The build key to map. + Current build context. Used for contextual information + if writing a more sophisticated mapping. + The new build key. + + + + A that will look for a build plan + in the current context. If it exists, it invokes it, otherwise + it creates one and stores it for later, and invokes it. + + + + + Called during the chain of responsibility for a build operation. + + The context for the operation. + + + + An implementation of that chooses + constructors based on these criteria: first, pick a constructor marked with the + attribute. If there + isn't one, then choose the constructor with the longest parameter list. If that is ambiguous, + then throw. + + Thrown when the constructor to choose is ambiguous. + Attribute used to mark the constructor to call. + + + + Base class that provides an implementation of + which lets you override how the parameter resolvers are created. + + + + + A that, when implemented, + will determine which constructor to call from the build plan. + + + + + Choose the constructor to call for the given type. + + Current build context + The to add any + generated resolver objects into. + The chosen constructor. + + + + Choose the constructor to call for the given type. + + Current build context + The to add any + generated resolver objects into. + The chosen constructor. + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. + + + + Value Condition Less than zerox is less than y.Zerox equals y.Greater than zerox is greater than y. + + + The second object to compare. + The first object to compare. + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + Objects of this type are the return value from . + It encapsulates the desired with the string keys + needed to look up the for each + parameter. + + + + + Base class for return values from selector policies that + return a memberinfo of some sort plus a list of parameter + keys to look up the parameter resolvers. + + + + + Base class for return of selector policies that need + to keep track of a set of parameter keys. + + + + + Add a new parameter key to this object. Keys are assumed + to be in the order of the parameters to the constructor. + + Key for the next parameter to look up. + + + + The set of keys for the constructor parameters. + + + + + Construct a new , storing + the given member info. + + Member info to store. + + + + The member info stored. + + + + + Create a new instance which + contains the given constructor. + + The constructor to wrap. + + + + The constructor this object wraps. + + + + + This class records the information about which constructor argument is currently + being resolved, and is responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + The type that is being constructed. + A string representing the constructor being called. + Parameter being resolved. + + + + Generate the string describing what parameter was being resolved. + + The description string. + + + + String describing the constructor being set up. + + + + + Parameter that's being resolved. + + + + + A that emits IL to call constructors + as part of creating a build plan. + + + + + Called during the chain of responsibility for a build operation. + + Existing object is an instance of . + The context for the operation. + + + + A helper method used by the generated IL to set up a PerResolveLifetimeManager lifetime manager + if the current object is such. + + Current build context. + + + + Build up the string that will represent the constructor signature + in any exception message. + + + + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A helper method used by the generated IL to throw an exception if + no existing object is present, but the user is attempting to build + an interface (usually due to the lack of a type mapping). + + The currently being + used for the build of this object. + + + + A helper method used by the generated IL to throw an exception if + a dependency cannot be resolved. + + The currently being + used for the build of this object. + + + + A helper method used by the generated IL to throw an exception if + a dependency cannot be resolved because of an invalid constructor. + + The currently being + used for the build of this object. + The signature of the invalid constructor. + + + + A class that records that a constructor is about to be call, and is + responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + + + + Generate the description string. + + The string. + + + + Constructor we're trying to call. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Helper method used by generated IL to look up a dependency resolver based on the given key. + + Current build context. + Type of the dependency being resolved. + Key the resolver was stored under. + The found dependency resolver. + + + + The type that is to be built with the dynamic build plan. + + + + + The context parameter represeting the used when the build plan is executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + An implementation + that constructs a build plan via dynamic IL emission. + + + + + Construct a that + uses the given strategy chain to construct the build plan. + + The strategy chain. + + + + Construct a build plan. + + The current build context. + The current build key. + The created build plan. + + + + A class that records that a constructor is about to be call, and is + responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + + + + Generate the description string. + + The string. + + + + Method we're trying to call. + + + + + This class records the information about which constructor argument is currently + being resolved, and is responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + The type that is being constructed. + A string representing the method being called. + Parameter being resolved. + + + + Generate the string describing what parameter was being resolved. + + The description string. + + + + String describing the method being set up. + + + + + Parameter that's being resolved. + + + + + A that generates IL to call + chosen methods (as specified by the current ) + as part of object build up. + + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A base class that holds the information shared by all operations + performed by the container while setting properties. + + + + + Initializes a new instance of the class. + + + + + Generate the description of this operation. + + The string. + + + + Get a format string used to create the description. Called by + the base method. + + The format string. + + + + The property value currently being resolved. + + + + + This class records the information about which property value is currently + being resolved, and is responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + + + + Get a format string used to create the description. Called by + the base method. + + The format string. + + + + A that generates IL to resolve properties + on an object being built. + + + + + Called during the chain of responsibility for a build operation. + + The context for the operation. + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + This class records the information about which property value is currently + being set, and is responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + Type property is on. + Name of property being set. + + + + Get a format string used to create the description. Called by + the base method. + + The format string. + + + + Creates an instance of this build plan's type, or fills + in the existing type if passed in. + + Context used to build up the object. + + + + An that will examine the given + types and return a sequence of objects + that should be called as part of building the object. + + + + + Return the sequence of methods to call while building the target object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of methods to call. + + + + An implementation of that selects + methods by looking for the given + attribute on those methods. + + Type of attribute used to mark methods + to inject. + + + + Base class that provides an implementation of + which lets you override how the parameter resolvers are created. + + Attribute that marks methods that should + be called. + + + + Return the sequence of methods to call while building the target object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of methods to call. + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + Objects of this type are the return value from . + It encapsulates the desired with the string keys + needed to look up the for each + parameter. + + + + + Create a new instance which + contains the given method. + + The method + + + + The constructor this object wraps. + + + + + An that returns a sequence + of properties that should be injected for the given type. + + + + + Returns sequence of properties on the given type that + should be set as part of building that object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of objects + that contain the properties to set. + + + + Base class that provides an implementation of + which lets you override how the parameter resolvers are created. + + + + + Returns sequence of properties on the given type that + should be set as part of building that object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of objects + that contain the properties to set. + + + + Create a for the given + property. + + Property to create resolver for. + The resolver object. + + + + An implementation of that looks + for properties marked with the + attribute that are also settable and not indexers. + + + + + + Create a for the given + property. + + Property to create resolver for. + The resolver object. + + + + Objects of this type are returned from + . + This class combines the about + the property with the string key used to look up the resolver + for this property's value. + + + + + Create an instance of + with the given and key. + + The property. + Key to use to look up the resolver. + + + + PropertyInfo for this property. + + + + + Key to look up this property's resolver. + + + + + Implementation of . + + + + + A builder policy that lets you keep track of the current + resolvers and will remove them from the given policy set. + + + + + Add a new resolver to track by key. + + Key that was used to add the resolver to the policy set. + + + + Remove the currently tracked resolvers from the given policy list. + + Policy list to remove the resolvers from. + + + + Add a new resolver to track by key. + + Key that was used to add the resolver to the policy set. + + + + Remove the currently tracked resolvers from the given policy list. + + Policy list to remove the resolvers from. + + + + Get an instance that implements , + either the current one in the policy set or creating a new one if it doesn't + exist. + + Policy list to look up from. + Build key to track. + The resolver tracker. + + + + Add a key to be tracked to the current tracker. + + Policy list containing the resolvers and trackers. + Build key for the resolvers being tracked. + Key for the resolver. + + + + Remove the resolvers for the given build key. + + Policy list containing the build key. + Build key. + + + + An implementation of that + calls back into the build chain to build up the dependency, passing + a type given at compile time as its build key. + + + + + Create a new instance storing the given type. + + Type to resolve. + + + + Get the value for a dependency. + + Current build context. + The value for the dependency. + + + + This interface defines a standard method to convert any + regardless + of the stage enum into a regular, flat strategy chain. + + + + + Convert this into + a flat . + + The flattened . + + + + Represents a chain of responsibility for builder strategies. + + + + + Reverse the order of the strategy chain. + + The reversed strategy chain. + + + + Execute this strategy chain against the given context, + calling the Buildup methods on the strategies. + + Context for the build process. + The build up object + + + + Execute this strategy chain against the given context, + calling the TearDown methods on the strategies. + + Context for the teardown process. + + + + A builder policy used to create lifetime policy instances. + Used by the LifetimeStrategy when instantiating open + generic types. + + + + + Create a new instance of . + + The new instance. + + + + The type of Lifetime manager that will be created by this factory. + + + + + An implementation that uses + a to figure out if an object + has already been created and to update or remove that + object from some backing store. + + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + Called during the chain of responsibility for a build operation. The + PostBuildUp method is called when the chain has finished the PreBuildUp + phase and executes in reverse order from the PreBuildUp calls. + + Context of the build operation. + + + + Represents a chain of responsibility for builder strategies partitioned by stages. + + The stage enumeration to partition the strategies. + + + + Initialize a new instance of the class. + + + + + Initialize a new instance of the class with an inner strategy chain to use when building. + + The inner strategy chain to use first when finding strategies in the build operation. + + + + Adds a strategy to the chain at a particular stage. + + The strategy to add to the chain. + The stage to add the strategy. + + + + Add a new strategy for the . + + The of + The stage to add the strategy. + + + + Clear the current strategy chain list. + + + This will not clear the inner strategy chain if this instane was created with one. + + + + + Makes a strategy chain based on this instance. + + A new . + + + + Represents a chain of responsibility for builder strategies. + + + + + Initialzie a new instance of the class. + + + + + Initialzie a new instance of the class with a colleciton of strategies. + + A collection of strategies to initialize the chain. + + + + Adds a strategy to the chain. + + The strategy to add to the chain. + + + + Adds strategies to the chain. + + The strategies to add to the chain. + + + + Reverse the order of the strategy chain. + + The reversed strategy chain. + + + + Execute this strategy chain against the given context to build up. + + Context for the build processes. + The build up object + + + + Execute this strategy chain against the given context, + calling the TearDown methods on the strategies. + + Context for the teardown process. + + + + Returns an enumerator that iterates through the collection. + + + + A that can be used to iterate through the collection. + + 1 + + + + Returns an enumerator that iterates through a collection. + + + + An object that can be used to iterate through the collection. + + 2 + + + + Build key used to combine a type object with a string name. Used by + ObjectBuilder to indicate exactly what is being built. + + + + + Create a new instance with the given + type and name. + + to build. + Key to use to look up type mappings and singletons. + + + + Create a new instance for the default + buildup of the given type. + + to build. + + + + This helper method creates a new instance. It is + initialized for the default key for the given type. + + Type to build. + A new instance. + + + + This helper method creates a new instance for + the given type and key. + + Type to build + Key to use to look up type mappings and singletons. + A new instance initialized with the given type and name. + + + + Compare two instances. + + Two instances compare equal + if they contain the same name and the same type. Also, comparing + against a different type will also return false. + Object to compare to. + True if the two keys are equal, false if not. + + + + Calculate a hash code for this instance. + + A hash code. + + + + Compare two instances for equality. + + Two instances compare equal + if they contain the same name and the same type. + First of the two keys to compare. + Second of the two keys to compare. + True if the values of the keys are the same, else false. + + + + Compare two instances for inequality. + + Two instances compare equal + if they contain the same name and the same type. If either field differs + the keys are not equal. + First of the two keys to compare. + Second of the two keys to compare. + false if the values of the keys are the same, else true. + + + + Formats the build key as a string (primarily for debugging). + + A readable string representation of the build key. + + + + Return the stored in this build key. + + The type to build. + + + + Returns the name stored in this build key. + + The name to use when building. + + + + A generic version of so that + you can new up a key using generic syntax. + + Type for the key. + + + + Construct a new that + specifies the given type. + + + + + Construct a new that + specifies the given type and name. + + Name for the key. + + + + A series of helper methods to deal with sequences - + objects that implement . + + + + + A function that turns an arbitrary parameter list into an + . + + Type of arguments. + The items to put into the collection. + An array that contains the values of the . + + + + Given two sequences, return a new sequence containing the corresponding values + from each one. + + Type of first sequence. + Type of second sequence. + First sequence of items. + Second sequence of items. + New sequence of pairs. This sequence ends when the shorter of sequence1 and sequence2 does. + + + + The exception thrown by the Unity container when + an attempt to resolve a dependency fails. + + + + + Create a new that records + the exception for the given type and name. + + Type requested from the container. + Name requested from the container. + The actual exception that caused the failure of the build. + The build context representing the failed operation. + + + + The type that was being requested from the container at the time of failure. + + + + + The name that was being requested from the container at the time of failure. + + + + + A that lets you register a + delegate with the container to create an object, rather than calling + the object's constructor. + + + + + Base class for all extension objects. + + + + + The container calls this method when the extension is added. + + A instance that gives the + extension access to the internals of the container. + + + + Initial the container with this extension's functionality. + + + When overridden in a derived class, this method will modify the given + by adding strategies, policies, etc. to + install it's functions into the container. + + + + Removes the extension's functions from the container. + + + + This method is called when extensions are being removed from the container. It can be + used to do things like disconnect event handlers or clean up member state. You do not + need to remove strategies or policies here; the container will do that automatically. + + + The default implementation of this method does nothing. + + + + + The container this extension has been added to. + + The that this extension has been added to. + + + + The object used to manipulate + the inner state of the container. + + + + + Initialize this extension. This particular extension requires no + initialization work. + + + + + Register the given factory delegate to be called when the container is + asked to resolve and . + + Type that will be requested from the container. + The name that will be used when requesting to resolve this type. + Delegate to invoke to create the instance. + The container extension object this method was invoked on. + + + + Register the given factory delegate to be called when the container is + asked to resolve . + + Type that will be requested from the container. + Delegate to invoke to create the instance. + The container extension object this method was invoked on. + + + + An implementation of that + acts as a decorator over another . + This checks to see if the current type being built is the + right one before checking the inner . + + + + + Create an instance of + + Type to check for. + Inner override to check after type matches. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + A convenience version of that lets you + specify the type to construct via generics syntax. + + Type to check for. + + + + Create an instance of . + + Inner override to check after type matches. + + + + Extension class that adds a set of convenience overloads to the + interface. + + + + + Register a type with specific members to be injected. + + Type this registration is for. + Container to configure. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container. + + + + This method is used to tell the container that when asked for type , + actually return an instance of type . This is very useful for + getting instances of interfaces. + + + This overload registers a default mapping and transient lifetime. + + + that will be requested. + that will actually be returned. + Container to configure. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container, where the created instances will use + the given . + + that will be requested. + that will actually be returned. + Container to configure. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container. + + + This method is used to tell the container that when asked for type , + actually return an instance of type . This is very useful for + getting instances of interfaces. + + that will be requested. + that will actually be returned. + Container to configure. + Name of this mapping. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container, where the created instances will use + the given . + + that will be requested. + that will actually be returned. + Container to configure. + Name to use for registration, null if a default registration. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type with the container. + No type mapping is performed for this type. + + The type to apply the to. + Container to configure. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type with the container. + No type mapping is performed for this type. + + The type to configure injection on. + Container to configure. + Name that will be used to request the type. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type and name with the container. + No type mapping is performed for this type. + + The type to apply the to. + Container to configure. + Name that will be used to request the type. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type with specific members to be injected. + + Container to configure. + Type this registration is for. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container. + + + + This method is used to tell the container that when asked for type , + actually return an instance of type . This is very useful for + getting instances of interfaces. + + + This overload registers a default mapping. + + + Container to configure. + that will be requested. + that will actually be returned. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container. + + + This method is used to tell the container that when asked for type , + actually return an instance of type . This is very useful for + getting instances of interfaces. + + Container to configure. + that will be requested. + that will actually be returned. + Name to use for registration, null if a default registration. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container, where the created instances will use + the given . + + Container to configure. + that will be requested. + that will actually be returned. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type and name with the container. + No type mapping is performed for this type. + + Container to configure. + The to apply the to. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type and name with the container. + No type mapping is performed for this type. + + Container to configure. + The to configure in the container. + Name to use for registration, null if a default registration. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type and name with the container. + No type mapping is performed for this type. + + Container to configure. + The to apply the to. + Name to use for registration, null if a default registration. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload does a default registration and has the container take over the lifetime of the instance. + + Type of instance to register (may be an implemented interface instead of the full type). + Container to configure. + Object to returned. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload does a default registration (name = null). + + + Type of instance to register (may be an implemented interface instead of the full type). + Container to configure. + Object to returned. + + object that controls how this instance will be managed by the container. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload automatically has the container take ownership of the . + + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Container to configure. + Name for registration. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Container to configure. + Name for registration. + + object that controls how this instance will be managed by the container. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload does a default registration and has the container take over the lifetime of the instance. + + Container to configure. + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload does a default registration (name = null). + + + Container to configure. + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + + object that controls how this instance will be managed by the container. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload automatically has the container take ownership of the . + + Container to configure. + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Name for registration. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Resolve an instance of the default requested type from the container. + + of object to get from the container. + Container to resolve from. + Any overrides for the resolve call. + The retrieved object. + + + + Resolve an instance of the requested type with the given name from the container. + + of object to get from the container. + Container to resolve from. + Name of the object to retrieve. + Any overrides for the resolve call. + The retrieved object. + + + + Resolve an instance of the default requested type from the container. + + Container to resolve from. + of object to get from the container. + Any overrides for the resolve call. + The retrieved object. + + + + Return instances of all registered types requested. + + + + This method is useful if you've registered multiple types with the same + but different names. + + + Be aware that this method does NOT return an instance for the default (unnamed) registration. + + + The type requested. + Container to resolve from. + Any overrides for the resolve calls. + Set of objects of type . + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + + This overload uses the default registrations. + + + of object to perform injection on. + Container to resolve through. + Instance to build up. + Any overrides for the buildup. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + of object to perform injection on. + Conatiner to resolve through. + Instance to build up. + name to use when looking up the typemappings and other configurations. + Any overrides for the Buildup. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + + This overload uses the default registrations. + + + Container to resolve through. + of object to perform injection on. + Instance to build up. + Any overrides for the Buildup. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Creates a new extension object and adds it to the container. + + Type of to add. The extension type + will be resolved from within the supplied . + Container to add the extension to. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Resolve access to a configuration interface exposed by an extension. + + Extensions can expose configuration interfaces as well as adding + strategies and policies to the container. This method walks the list of + added extensions and returns the first one that implements the requested type. + + The configuration interface required. + Container to configure. + The requested extension's configuration interface, or null if not found. + + + + Check if a particular type has been registered with the container with + the default name. + + Container to inspect. + Type to check registration for. + True if this type has been registered, false if not. + + + + Check if a particular type/name pair has been registered with the container. + + Container to inspect. + Type to check registration for. + Name to check registration for. + True if this type/name pair has been registered, false if not. + + + + Check if a particular type has been registered with the container with the default name. + + Type to check registration for. + Container to inspect. + True if this type has been registered, false if not. + + + + Check if a particular type/name pair has been registered with the container. + + Type to check registration for. + Container to inspect. + Name to check registration for. + True if this type/name pair has been registered, false if not. + + + + The class provides the means for extension objects + to manipulate the internal state of the . + + + + + Store a type/name pair for later resolution. + + + + When users register type mappings (or other things) with a named key, this method + allows you to register that name with the container so that when the + method is called, that name is included in the list that is returned. + + to register. + Name assocated with that type. + + + + The container that this context is associated with. + + The object. + + + + The strategies this container uses. + + The that the container uses to build objects. + + + + The strategies this container uses to construct build plans. + + The that this container uses when creating + build plans. + + + + The policies this container uses. + + The the that container uses to build objects. + + + + The that this container uses. + + The is used to manage objects that the container is managing. + + + + This event is raised when the method, + or one of its overloads, is called. + + + + + This event is raised when the method, + or one of its overloads, is called. + + + + + This event is raised when the method is called, providing + the newly created child container to extensions to act on as they see fit. + + + + + An EventArgs class that holds a string Name. + + + + + Create a new with a null name. + + + + + Create a new with the given name. + + Name to store. + + + + The name. + + Name used for this event arg object. + + + + Event argument class for the event. + + + + + Create a new instance of . + + Type to map from. + Type to map to. + Name for the registration. + to manage instances. + + + + Type to map from. + + + + + Type to map to. + + + + + to manage instances. + + + + + Event argument class for the event. + + + + + Create a default instance. + + + + + Create a instance initialized with the given arguments. + + Type of instance being registered. + The instance object itself. + Name to register under, null if default registration. + object that handles how + the instance will be owned. + + + + Type of instance being registered. + + + Type of instance being registered. + + + + + Instance object being registered. + + Instance object being registered + + + + that controls ownership of + this instance. + + + + + A that lets you specify that + an instance of a generic type parameter should be resolved. + + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + name to use when looking up in the container. + + + + Return a instance that will + return this types value for the parameter. + + The actual type to resolve. + The resolution key. + The . + + + + A that lets you specify that + an array containing the registered instances of a generic type parameter + should be resolved. + + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + The values for the elements, that will + be converted to objects. + + + + Test to see if this parameter value has a matching type for the given type. + + Type to check. + True if this parameter value is compatible with type , + false if not. + A type is considered compatible if it is an array type of rank one + and its element type is a generic type parameter with a name matching this generic + parameter name configured for the receiver. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + Name for the type represented by this . + This may be an actual type name or a generic argument name. + + + + + A Unity container extension that allows you to configure + which constructors, properties, and methods get injected + via an API rather than through attributes. + + + + + Initial the container with this extension's functionality. + + + When overridden in a derived class, this method will modify the given + by adding strategies, policies, etc. to + install it's functions into the container. + + + + API to configure the injection settings for a particular type. + + Type the injection is being configured for. + Objects containing the details on which members to inject and how. + This extension object. + + + + API to configure the injection settings for a particular type/name pair. + + Type the injection is being configured for. + Name of registration + Objects containing the details on which members to inject and how. + This extension object. + + + + API to configure the injection settings for a particular type. + + Type to configure. + Objects containing the details on which members to inject and how. + This extension object. + + + + API to configure the injection settings for a particular type/name pair. + + Type to configure. + Name of registration. + Objects containing the details on which members to inject and how. + This extension object. + + + + API to configure the injection settings for a particular type/name pair. + + Type of interface/base class being registered (may be null). + Type of actual implementation class being registered. + Name of registration. + Objects containing the details on which members to inject and how. + This extension object. + + + + A class that holds the collection of information + for a constructor, so that the container can + be configured to call this constructor. + + + + + Create a new instance of that looks + for a constructor with the given set of parameters. + + The values for the parameters, that will + be converted to objects. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Interface registered, ignored in this implementation. + Type to register. + Name used to resolve the type object. + Policy list to add policies to. + + + + An that configures the + container to call a method as part of buildup. + + + + + Create a new instance which will configure + the container to call the given methods with the given parameters. + + Name of the method to call. + Parameter values for the method. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Type of interface registered, ignored in this implementation. + Type to register. + Name used to resolve the type object. + Policy list to add policies to. + + + + A small function to handle name matching. You can override this + to do things like case insensitive comparisons. + + MethodInfo for the method you're checking. + Name of the method you're looking for. + True if a match, false if not. + + + + A class that holds on to the given value and provides + the required + when the container is configured. + + + + + Create an instance of that stores + the given value, using the runtime type of that value as the + type of the parameter. + + Value to be injected for this parameter. + + + + Create an instance of that stores + the given value, associated with the given type. + + Type of the parameter. + Value of the parameter + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + A generic version of that makes it a + little easier to specify the type of the parameter. + + Type of parameter. + + + + Create a new . + + Value for the parameter. + + + + This class stores information about which properties to inject, + and will configure the container accordingly. + + + + + Configure the container to inject the given property name, + resolving the value via the container. + + Name of the property to inject. + + + + Configure the container to inject the given property name, + using the value supplied. This value is converted to an + object using the + rules defined by the + method. + + Name of property to inject. + Value for property. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Interface being registered, ignored in this implemenation. + Type to register. + Name used to resolve the type object. + Policy list to add policies to. + + + + A class that stores a type, and generates a + resolver object that resolves all the named instances or the + type registered in a container. + + + + + Construct a new that + resolves to the given element type and collection of element values. + + The type of elements to resolve. + The values for the elements, that will + be converted to objects. + + + + Construct a new that + resolves to the given array and element types and collection of element values. + + The type for the array of elements to resolve. + The type of elements to resolve. + The values for the elements, that will + be converted to objects. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + A generic version of for convenience + when creating them by hand. + + Type of the elements for the array of the parameter. + + + + Construct a new that + resolves to the given element generic type with the given element values. + + The values for the elements, that will + be converted to objects. + + + + Interface defining the behavior of the Unity dependency injection container. + + + + + Register a type mapping with the container, where the created instances will use + the given . + + that will be requested. + that will actually be returned. + Name to use for registration, null if a default registration. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Name for registration. + + object that controls how this instance will be managed by the container. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Resolve an instance of the requested type with the given name from the container. + + of object to get from the container. + Name of the object to retrieve. + Any overrides for the resolve call. + The retrieved object. + + + + Return instances of all registered types requested. + + + + This method is useful if you've registered multiple types with the same + but different names. + + + Be aware that this method does NOT return an instance for the default (unnamed) registration. + + + The type requested. + Any overrides for the resolve calls. + Set of objects of type . + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + of object to perform injection on. + Instance to build up. + name to use when looking up the typemappings and other configurations. + Any overrides for the resolve calls. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Run an existing object through the container, and clean it up. + + The object to tear down. + + + + Add an extension object to the container. + + to add. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Resolve access to a configuration interface exposed by an extension. + + Extensions can expose configuration interfaces as well as adding + strategies and policies to the container. This method walks the list of + added extensions and returns the first one that implements the requested type. + + of configuration interface required. + The requested extension's configuration interface, or null if not found. + + + + Remove all installed extensions from this container. + + + + This method removes all extensions from the container, including the default ones + that implement the out-of-the-box behavior. After this method, if you want to use + the container again you will need to either readd the default extensions or replace + them with your own. + + + The registered instances and singletons that have already been set up in this container + do not get removed. + + + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Create a child container. + + + A child container shares the parent's configuration, but can be configured with different + settings or lifetime. + The new child container. + + + + The parent of this container. + + The parent container, or null if this container doesn't have one. + + + + Get a sequence of that describe the current state + of the container. + + + + + A that holds a weak reference to + it's managed instance. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + + + + Remove the given object from backing store. + + + + + An implementation of that + creates instances of the type of the given Lifetime Manager + by resolving them through the container. + + + + + Create a new that will + return instances of the given type, creating them by + resolving through the container. + + Container to resolve with. + Type of LifetimeManager to create. + + + + Create a new instance of . + + The new instance. + + + + The type of Lifetime manager that will be created by this factory. + + + + + A that holds the instances given to it, + keeping one instance per thread. + + + + This LifetimeManager does not dispose the instances it holds. + + + + + + Initializes a new instance of the class. + + + + + Retrieve a value from the backing store associated with this Lifetime policy for the + current thread. + + the object desired, or if no such object is currently + stored for the current thread. + + + + Stores the given value into backing store for retrieval later when requested + in the current thread. + + The object being stored. + + + + Remove the given object from backing store. + + Not implemented for this lifetime manager. + + + + An implementation that does nothing, + thus ensuring that instances are created new every time. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + + + + Remove the given object from backing store. + + + + + This strategy implements the logic that will call container.ResolveAll + when an array parameter is detected. + + + + + Do the PreBuildUp stage of construction. This is where the actual work is performed. + + Current build context. + + + + An implementation of that is + aware of the build keys used by the Unity container. + + + + + Create a instance for the given + . + + + This implementation looks for the Unity on the + parameter and uses it to create an instance of + for this parameter. + Parameter to create the resolver for. + The resolver object. + + + + An implementation of that is aware + of the build keys used by the Unity container. + + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + An implementation of that is aware of + the build keys used by the unity container. + + + + + Create a for the given + property. + + Property to create resolver for. + The resolver object. + + + + A implementation that returns + the value set in the constructor. + + + + + Create a new instance of + which will return the given value when resolved. + + The value to return. + + + + Get the value for a dependency. + + Current build context. + The value for the dependency. + + + + An implementation of that stores a + type and name, and at resolution time puts them together into a + . + + + + + Create an instance of + with the given type and name. + + The type. + The name (may be null). + + + + Resolve the value for a dependency. + + Current build context. + The value for the dependency. + + + + The type that this resolver resolves. + + + + + The name that this resolver resolves. + + + + + An implementation of that resolves to + to an array populated with the values that result from resolving other instances + of . + + + + + Create an instance of + with the given type and a collection of + instances to use when populating the result. + + The type. + The resolver policies to use when populating an array. + + + + Resolve the value for a dependency. + + Current build context. + An array pupulated with the results of resolving the resolver policies. + + + + An implementation of that selects + the given constructor and creates the appropriate resolvers to call it with + the specified parameters. + + + + + Create an instance of that + will return the given constructor, being passed the given injection values + as parameters. + + The constructor to call. + Set of objects + that describes how to obtain the values for the constructor parameters. + + + + Choose the constructor to call for the given type. + + Current build context + The to add any + generated resolver objects into. + The chosen constructor. + + + + Helper class for implementing selector policies that need to + set up dependency resolver policies. + + + + + Add dependency resolvers to the parameter set. + + Type that's currently being built (used to resolve open generics). + PolicyList to add the resolvers to. + Objects supplying the dependency resolvers. + Result object to store the keys in. + + + + A implementation that calls the specific + methods with the given parameters. + + + + + Add the given method and parameter collection to the list of methods + that will be returned when the selector's + method is called. + + Method to call. + sequence of objects + that describe how to create the method parameter values. + + + + Return the sequence of methods to call while building the target object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of methods to call. + + + + An implemnetation of which returns + the set of specific properties that the selector was configured with. + + + + + Add a property that will be par of the set returned when the + is called. + + The property to set. + object describing + how to create the value to inject. + + + + Returns sequence of properties on the given type that + should be set as part of building that object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of objects + that contain the properties to set. + + + + A class that stores a name and type, and generates a + resolver object that resolves the parameter via the + container. + + + + + Construct a new that + resolves to the given type. + + Type of this parameter. + + + + Construct a new that + resolves the given type and name. + + Type of this parameter. + Name to use when resolving parameter. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + A generic version of for convenience + when creating them by hand. + + Type of the parameter + + + + Create a new for the given + generic type and the default name. + + + + + Create a new for the given + generic type and name. + + Name to use to resolve this parameter. + + + + An implementation of that wraps a Unity container. + + + + + Initializes a new instance of the class for a container. + + The to wrap with the + interface implementation. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + 2 + + + + When implemented by inheriting classes, this method will do the actual work of resolving + the requested service instance. + + Type of instance requested.Name of registered service you want. May be null. + + The requested service instance. + + + + + When implemented by inheriting classes, this method will do the actual work of + resolving all the requested service instances. + + Type of service requested. + + Sequence of service instance objects. + + + + + A static helper class that includes various parameter checking routines. + + + + + Throws if the given argument is null. + + if tested value if null. + Argument value to test. + Name of the argument being tested. + + + + Throws an exception if the tested string argument is null or the empty string. + + Thrown if string value is null. + Thrown if the string is empty + Argument value to check. + Name of argument being checked. + + + + Verifies that an argument type is assignable from the provided type (meaning + interfaces are implemented, or classes exist in the base class hierarchy). + + The argument type that will be assigned to. + The type of the value being assigned. + Argument name. + + + + Verifies that an argument instance is assignable from the provided type (meaning + interfaces are implemented, or classes exist in the base class hierarchy, or instance can be + assigned through a runtime wrapper, as is the case for COM Objects). + + The argument type that will be assigned to. + The instance that will be assigned. + Argument name. + + + + The build stages we use in the Unity container + strategy pipeline. + + + + + First stage. By default, nothing happens here. + + + + + Second stage. Type mapping occurs here. + + + + + Third stage. lifetime managers are checked here, + and if they're available the rest of the pipeline is skipped. + + + + + Fourth stage. Reflection over constructors, properties, etc. is + performed here. + + + + + Fifth stage. Instance creation happens here. + + + + + Sixth stage. Property sets and method injection happens here. + + + + + Seventh and final stage. By default, nothing happens here. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The type {0} has multiple constructors of length {1}. Unable to disambiguate.. + + + + + Looks up a localized string similar to The provided string argument must not be empty.. + + + + + Looks up a localized string similar to The current build operation (build key {2}) failed: {3} (Strategy type {0}, index {1}). + + + + + Looks up a localized string similar to The current type, {0}, is an interface and cannot be constructed. Are you missing a type mapping?. + + + + + Looks up a localized string similar to Cannot extract type from build key {0}.. + + + + + Looks up a localized string similar to The method {0}.{1}({2}) is an open generic method. Open generic methods cannot be injected.. + + + + + Looks up a localized string similar to The property {0} on type {1} is an indexer. Indexed properties cannot be injected.. + + + + + Looks up a localized string similar to The method {1} on type {0} has an out parameter. Injection cannot be performed.. + + + + + Looks up a localized string similar to The method {0}.{1}({2}) has at least one out parameter. Methods with out parameters cannot be injected.. + + + + + Looks up a localized string similar to The method {0}.{1}({2}) has at least one ref parameter.Methods with ref parameters cannot be injected.. + + + + + Looks up a localized string similar to The method {1} on type {0} is marked for injection, but it is an open generic method. Injection cannot be performed.. + + + + + Looks up a localized string similar to The method {0}.{1}({2}) is static. Static methods cannot be injected.. + + + + + Looks up a localized string similar to The type {0} is an open generic type. An open generic type cannot be resolved.. + + + + + Looks up a localized string similar to Resolving parameter "{0}" of constructor {1}. + + + + + Looks up a localized string similar to The parameter {0} could not be resolved when attempting to call constructor {1}.. + + + + + Looks up a localized string similar to An attempt to override an existing mapping was detected for type {1} with name "{0}", currently mapped to type {2}, to type {3}.. + + + + + Looks up a localized string similar to The set of assemblies contains a null element.. + + + + + Looks up a localized string similar to Parameter type inference does not work for null values. Indicate the parameter type explicitly using a properly configured instance of the InjectionParameter or InjectionParameter<T> classes.. + + + + + Looks up a localized string similar to Calling constructor {0}. + + + + + Looks up a localized string similar to Calling method {0}.{1}. + + + + + Looks up a localized string similar to An item with the given key is already present in the dictionary.. + + + + + Looks up a localized string similar to The lifetime manager is already registered. Lifetime managers cannot be reused, please create a new one.. + + + + + Looks up a localized string similar to The override marker build plan policy has been invoked. This should never happen, looks like a bug in the container.. + + + + + Looks up a localized string similar to Resolving parameter "{0}" of method {1}.{2}. + + + + + Looks up a localized string similar to The value for parameter "{1}" of method {0} could not be resolved. . + + + + + Looks up a localized string similar to Could not resolve dependency for build key {0}.. + + + + + Looks up a localized string similar to The type {0} has multiple constructors marked with the InjectionConstructor attribute. Unable to disambiguate.. + + + + + Looks up a localized string similar to The supplied type {0} must be an open generic type.. + + + + + Looks up a localized string similar to The supplied type {0} does not have the same number of generic arguments as the target type {1}.. + + + + + Looks up a localized string similar to The type {0} does not have an accessible constructor.. + + + + + Looks up a localized string similar to The type {0} does not have a generic argument named "{1}". + + + + + Looks up a localized string similar to while resolving. + + + + + Looks up a localized string similar to The type {0} does not have a constructor that takes the parameters ({1}).. + + + + + Looks up a localized string similar to The type {0} does not have a public method named {1} that takes the parameters ({2}).. + + + + + Looks up a localized string similar to The type {0} does not contain an instance property named {1}.. + + + + + Looks up a localized string similar to The type {0} is not a generic type, and you are attempting to inject a generic parameter named "{1}".. + + + + + Looks up a localized string similar to The type {0} is not an array type with rank 1, and you are attempting to use a [DependencyArray] attribute on a parameter or property with this type.. + + + + + Looks up a localized string similar to Optional dependencies must be reference types. The type {0} is a value type.. + + + + + Looks up a localized string similar to The property {0} on type {1} is not settable.. + + + + + Looks up a localized string similar to The property {0} on type {1} is of type {2}, and cannot be injected with a value of type {3}.. + + + + + Looks up a localized string similar to The value for the property "{0}" could not be resolved.. + + + + + Looks up a localized string similar to The provided string argument must not be empty.. + + + + + Looks up a localized string similar to Resolution of the dependency failed, type = "{0}", name = "{1}". + Exception occurred while: {2}. + Exception is: {3} - {4} + ----------------------------------------------- + At the time of the exception, the container was: + . + + + + + Looks up a localized string similar to Resolving {0},{1}. + + + + + Looks up a localized string similar to Resolving {0},{1} (mapped from {2}, {3}). + + + + + Looks up a localized string similar to Resolving value for property {0}.{1}. + + + + + Looks up a localized string similar to The constructor {1} selected for type {0} has ref or out parameters. Such parameters are not supported for constructor injection.. + + + + + Looks up a localized string similar to Setting value for property {0}.{1}. + + + + + Looks up a localized string similar to The type {0} cannot be constructed. You must configure the container to supply this value.. + + + + + Looks up a localized string similar to The type {1} cannot be assigned to variables of type {0}.. + + + + + Looks up a localized string similar to <unknown>. + + + + + A simple, extensible dependency injection container. + + + + + Create a default . + + + + + Create a with the given parent container. + + The parent . The current object + will apply its own settings first, and then check the parent for additional ones. + + + + RegisterType a type mapping with the container, where the created instances will use + the given . + + that will be requested. + that will actually be returned. + Name to use for registration, null if a default registration. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + RegisterType an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Name for registration. + + If true, the container will take over the lifetime of the instance, + calling Dispose on it (if it's ) when the container is Disposed. + + If false, container will not maintain a strong reference to . User is reponsible + for disposing instance, and for keeping the instance from being garbage collected. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Get an instance of the requested type with the given name from the container. + + of object to get from the container. + Name of the object to retrieve. + Any overrides for the resolve call. + The retrieved object. + + + + Return instances of all registered types requested. + + + + This method is useful if you've registered multiple types with the same + but different names. + + + Be aware that this method does NOT return an instance for the default (unnamed) registration. + + + The type requested. + Any overrides for the resolve calls. + Set of objects of type . + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + of object to perform injection on. + Instance to build up. + name to use when looking up the typemappings and other configurations. + Any overrides for the buildup. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Run an existing object through the container, and clean it up. + + The object to tear down. + + + + Add an extension object to the container. + + to add. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Get access to a configuration interface exposed by an extension. + + Extensions can expose configuration interfaces as well as adding + strategies and policies to the container. This method walks the list of + added extensions and returns the first one that implements the requested type. + + of configuration interface required. + The requested extension's configuration interface, or null if not found. + + + + Remove all installed extensions from this container. + + + + This method removes all extensions from the container, including the default ones + that implement the out-of-the-box behavior. After this method, if you want to use + the container again you will need to either readd the default extensions or replace + them with your own. + + + The registered instances and singletons that have already been set up in this container + do not get removed. + + + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Create a child container. + + + A child container shares the parent's configuration, but can be configured with different + settings or lifetime. + The new child container. + + + + Dispose this container instance. + + + Disposing the container also disposes any child containers, + and disposes any instances whose lifetimes are managed + by the container. + + + + + Dispose this container instance. + + + This class doesn't have a finalizer, so will always be true. + True if being called from the IDisposable.Dispose + method, false if being called from a finalizer. + + + + Remove policies associated with building this type. This removes the + compiled build plan so that it can be rebuilt with the new settings + the next time this type is resolved. + + Type of object to clear the plan for. + Name the object is being registered with. + + + + The parent of this container. + + The parent container, or null if this container doesn't have one. + + + + Get a sequence of that describe the current state + of the container. + + + + + Implementation of the ExtensionContext that is actually used + by the UnityContainer implementation. + + + This is a nested class so that it can access state in the + container that would otherwise be inaccessible. + + + + + This event is raised when the method, + or one of its overloads, is called. + + + + + This extension supplies the default behavior of the UnityContainer API + by handling the context events and setting policies. + + + + + Install the default container behavior into the container. + + + + + Remove the default behavior from the container. + + + + + This extension installs the default strategies and policies into the container + to implement the standard behavior of the Unity container. + + + + + Add the default ObjectBuilder strategies & policies to the container. + + + + + Helper class to wrap common reflection stuff dealing with + methods. + + + + + Create a new instance that + lets us do more reflection stuff on that method. + + The method to reflect on. + + + + Given our set of generic type arguments, + + The generic type arguments. + An array with closed parameter types. + + + + Returns true if any of the parameters of this method + are open generics. + + + + + Return the of each parameter for this + method. + + Sequence of objects, one for + each parameter in order. + + + + A helper class that encapsulates two different + data items together into a a single item. + + + + + Create a new containing + the two values give. + + First value + Second value + + + + The first value of the pair. + + + + + The second value of the pair. + + + + + Container for a Pair helper method. + + + + + A helper factory method that lets users take advantage of type inference. + + Type of first value. + Type of second value. + First value. + Second value. + A new instance. + + + + A utility class that handles the logic of matching parameter + lists, so we can find the right constructor and method overloads. + + + + + Create a new that will attempt to + match the given parameter types. + + Target parameters to match against. + + + + Tests to see if the given set of types matches the ones + we're looking for. + + parameter list to look for. + true if they match, false if they don't. + + + + Tests to see if the given set of types matches the ones we're looking for. + + Candidate method signature to look for. + True if they match, false if they don't. + + + + Another reflection helper class that has extra methods + for dealing with ParameterInfos. + + + + + A small helper class to encapsulate details of the + reflection API, particularly around generics. + + + + + Create a new instance that + lets you look at information about the given type. + + Type to do reflection on. + + + + Test the given object, looking at + the parameters. Determine if any of the parameters are + open generic types that need type attributes filled in. + + The method to check. + True if any of the parameters are open generics. False if not. + + + + If this type is an open generic, use the + given array to + determine what the required closed type is and return that. + + If the parameter is not an open type, just + return this parameter's type. + Type arguments to substitute in for + the open type parameters. + Corresponding closed type of this parameter. + + + + Given a generic argument name, return the corresponding type for this + closed type. For example, if the current type is SomeType<User>, and the + corresponding definition was SomeType<TSomething>, calling this method + and passing "TSomething" will return typeof(User). + + Name of the generic parameter. + Type of the corresponding generic parameter, or null if there + is no matching name. + + + + The object we're reflecting over. + + + + + Is this type generic? + + + + + Is this type an open generic (no type parameter specified) + + + + + Is this type an array type? + + + + + Is this type an array of generic elements? + + + + + The type of the elements in this type (if it's an array). + + + + + Returns all the public constructors defined for the current reflected . + + + An enumeration of ConstructorInfo objects representing all the public instance constructors defined for the + current reflected , but not including the type initializer (static constructor). + + + + + Create a new instance of that + lets you query information about the given ParameterInfo object. + + Parameter to query. + + + + A set of helper methods to pick through lambdas and pull out + from them. + + + + + Pull out a object from an expression of the form + () => SomeClass.SomeMethod() + + Expression describing the method to call. + Corresponding . + + + + Pull out a object from an expression of the form + x => x.SomeMethod() + + The type where the method is defined. + Expression describing the method to call. + Corresponding . + + + + Pull out a object for the get method from an expression of the form + x => x.SomeProperty + + The type where the method is defined. + The type for the property. + Expression describing the property for which the get method is to be extracted. + Corresponding . + + + + Pull out a object for the set method from an expression of the form + x => x.SomeProperty + + The type where the method is defined. + The type for the property. + Expression describing the property for which the set method is to be extracted. + Corresponding . + + + + + + + + + + + + + Pull out a object from an expression of the form () => new SomeType() + + The type where the constructor is defined. + Expression invoking the desired constructor. + Corresponding . + + + diff -r 000000000000 -r 5bca2d201ad8 src/packages/Unity.3.0.1304.1/lib/NetCore45/Microsoft.Practices.Unity.NetCore.dll Binary file src/packages/Unity.3.0.1304.1/lib/NetCore45/Microsoft.Practices.Unity.NetCore.dll has changed diff -r 000000000000 -r 5bca2d201ad8 src/packages/Unity.3.0.1304.1/lib/NetCore45/Microsoft.Practices.Unity.NetCore.pri Binary file src/packages/Unity.3.0.1304.1/lib/NetCore45/Microsoft.Practices.Unity.NetCore.pri has changed diff -r 000000000000 -r 5bca2d201ad8 src/packages/Unity.3.0.1304.1/lib/NetCore45/Microsoft.Practices.Unity.NetCore.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/packages/Unity.3.0.1304.1/lib/NetCore45/Microsoft.Practices.Unity.NetCore.xml Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,6049 @@ + + + + Microsoft.Practices.Unity.NetCore + + + + + A that emits IL to call constructors + as part of creating a build plan. + + + + + Represents a strategy in the chain of responsibility. + Strategies are required to support both BuildUp and TearDown. + + + + + Represents a strategy in the chain of responsibility. + Strategies are required to support both BuildUp and TearDown. Although you + can implement this interface directly, you may also choose to use + as the base class for your strategies, as + this class provides useful helper methods and makes support BuildUp and TearDown + optional. + + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + Called during the chain of responsibility for a build operation. The + PostBuildUp method is called when the chain has finished the PreBuildUp + phase and executes in reverse order from the PreBuildUp calls. + + Context of the build operation. + + + + Called during the chain of responsibility for a teardown operation. The + PreTearDown method is called when the chain is being executed in the + forward direction. + + Context of the teardown operation. + + + + Called during the chain of responsibility for a teardown operation. The + PostTearDown method is called when the chain has finished the PreTearDown + phase and executes in reverse order from the PreTearDown calls. + + Context of the teardown operation. + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + Called during the chain of responsibility for a build operation. The + PostBuildUp method is called when the chain has finished the PreBuildUp + phase and executes in reverse order from the PreBuildUp calls. + + Context of the build operation. + + + + Called during the chain of responsibility for a teardown operation. The + PreTearDown method is called when the chain is being executed in the + forward direction. + + Context of the teardown operation. + + + + Called during the chain of responsibility for a teardown operation. The + PostTearDown method is called when the chain has finished the PreTearDown + phase and executes in reverse order from the PreTearDown calls. + + Context of the teardown operation. + + + + Called during the chain of responsibility for a build operation. + + Existing object is an instance of . + The context for the operation. + + + + A helper method used by the generated IL to set up a PerResolveLifetimeManager lifetime manager + if the current object is such. + + Current build context. + + + + Build up the string that will represent the constructor signature + in any exception message. + + + + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A helper method used by the generated IL to throw an exception if + no existing object is present, but the user is attempting to build + an interface (usually due to the lack of a type mapping). + + The currently being + used for the build of this object. + + + + A helper method used by the generated IL to throw an exception if + a dependency cannot be resolved. + + The currently being + used for the build of this object. + + + + A helper method used by the generated IL to throw an exception if + a dependency cannot be resolved because of an invalid constructor. + + The currently being + used for the build of this object. + The signature of the invalid constructor. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Helper method used by generated IL to look up a dependency resolver based on the given key. + + Current build context. + Type of the dependency being resolved. + Key the resolver was stored under. + The found dependency resolver. + + + + The type that is to be built with the dynamic build plan. + + + + + The context parameter represeting the used when the build plan is executed. + + + + + + + + + + + + + + + + A build plan is an object that, when invoked, will create a new object + or fill in a given existing one. It encapsulates all the information + gathered by the strategies to construct a particular object. + + + + + Represents a builder policy interface. Since there are no fixed requirements + for policies, it acts as a marker interface from which to derive all other + policy interfaces. + + + + + Creates an instance of this build plan's type, or fills + in the existing type if passed in. + + Context used to build up the object. + + + + + + + + + + + + + + + + An implementation + that constructs a build plan via dynamic IL emission. + + + + + A that can create and return an + for the given build key. + + + + + Create a build plan using the given context and build key. + + Current build context. + Current build key. + The build plan. + + + + Construct a that + uses the given strategy chain to construct the build plan. + + The strategy chain. + + + + Construct a build plan. + + The current build context. + The current build key. + The created build plan. + + + + A that generates IL to call + chosen methods (as specified by the current ) + as part of object build up. + + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A that generates IL to resolve properties + on an object being built. + + + + + Called during the chain of responsibility for a build operation. + + The context for the operation. + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + An implementation + that constructs a build plan for creating objects. + + + + + Creates a build plan using the given context and build key. + + Current build context. + Current build key. + + The build plan. + + + + + Provides helper methods to retrieve classes from assemblies. + + + + + Returns all visible, non-abstract classes from . + + The assemblies. + All visible, non-abstract classes found in the assemblies. + is . + contains elements. + All exceptions thrown while getting types from the assemblies are ignored, and the types that can be retrieved are returned. + + + + Returns all visible, non-abstract classes from , and optionally skips errors. + + to skip errors; otherwise, . + The assemblies. + + All visible, non-abstract classes. + + is . + contains elements. + + If is , all exceptions thrown while getting types from the assemblies are ignored, and the types + that can be retrieved are returned; otherwise, the original exception is thrown. + + + + + Returns all visible, non-abstract classes from . + + to skip errors; otherwise, . + The assemblies. + + All visible, non-abstract classes. + + is . + contains elements. + + If is , all exceptions thrown while getting types from the assemblies are ignored, and the types + that can be retrieved are returned; otherwise, the original exception is thrown. + + + + + Returns all visible, non-abstract classes from all assemblies located where the application is installed. + + to include the Unity assemblies; otherwise, . Defaults to . + to skip errors; otherwise, . + + All visible, non-abstract classes. + + + If is , all exceptions thrown while loading assemblies or getting types from the assemblies + are ignored, and the types that can be retrieved are returned; otherwise, the original exception is thrown. These exceptions might be wrapped in a + . + + + + + The exception that is thrown when registering multiple types would result in an type mapping being overwritten. + + + + + Initializes a new instance of the class. + + The name for the mapping. + The source type for the mapping. + The type currently mapped. + The new type to map. + + + + Gets the name for the mapping. + + + + + Gets the source type for the mapping. + + + + + Gets the type currently mapped. + + + + + Gets the new type to map. + + + + + Represents a set of types to register and their registration settings. + + + + + Gets types to register. + + + + + Gets a function to get the types that will be requested for each type to configure. + + + + + Gets a function to get the name to use for the registration of each type. + + + + + Gets a function to get the for the registration of each type. Defaults to no lifetime management. + + + + + + Gets a function to get the additional objects for the registration of each type. Defaults to no injection members. + + + + + + Provides a set of convenience overloads to the + interface to support registration of multiple types. + + + + + Registers the supplied types by using the specified rules for name, lifetime manager, injection members, and registration types. + + The container to configure. + The types to register. The methods in the class can be used to scan assemblies to get types, and further filtering can be performed using LINQ queries. + A function that gets the types that will be requested for each type to configure. It can be a method from the class or a custom function. Defaults to no registration types, and registers only the supplied types. + A function that gets the name to use for the registration of each type. It can be a method from the or a custom function. Defaults to no name. + A function that gets the for the registration of each type. It can be a method from the class or a custom function. Defaults to no lifetime management. + A function that gets the additional objects for the registration of each type. Defaults to no injection members. + to overwrite existing mappings; otherwise, . Defaults to . + + The container that this method was called on. + + A new registration would overwrite an existing mapping and is . + + + + Registers the types according to the . + + The container to configure. + The convention to determine which types will be registered and how. + to overwrite existing mappings; otherwise, . Defaults to . + + The container that this method was called on. + + + + + Provides helper methods to specify the lifetime for a type with registration by convention. + + + + + Returns a . + + The type. + A lifetime manager + + + + Returns a . + + The type. + A container controlled lifetime manager. + + + + Returns a . + + The type. + An externally controlled lifetime manager. + + + + Returns a . + + The type. + A hierarchical lifetime manager. + + + + Returns a . + + The type. + A per resolve lifetime manager. + + + + Returns a . + + The type. + A transient lifetime manager. + + + + Returns a . + + The custom type. + The type. + + A lifetime manager. + + + + + Provides helper methods to map types to the types interfaces to which register them. + + + + + Returns no types. + + The type to register. + An empty enumeration. + + + + Returns an enumeration with the interface that matches the name of . + + The type to register. + An enumeration with the first interface matching the name of (for example, if type is MyType, a matching interface is IMyType), + or an empty enumeration if no such interface is found. + + + + Returns an enumeration with all the interfaces implemented by . + + The type to register. + An enumeration with all the interfaces implemented by the implementation type except . + + + + Returns an enumeration with all the interfaces implemented by that belong to the same assembly as implementationType. + + The type to register. + An enumeration with all the interfaces implemented by the implementation type that belong to the same assembly. + + + + Provides helper methods to get type names. + + + + + Returns the type name. + + The type. + The type name. + + + + Returns null for the registration name. + + The type. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + The type {0} has multiple constructors of length {1}. Unable to disambig... + + + + + The provided string argument must not be empty. + + + + + The current build operation (build key {2}) failed: {3} (Strategy type {... + + + + + The current type {0} is an interface and cannot be constructed. Are you ... + + + + + Cannot extract type from build key {0}. + + + + + The method {0}.{1}({2}) is an open generic method. Open generic methods ... + + + + + The property {0} on type {1} is an indexer. Indexed properties cannot be... + + + + + The method {1} on type {0} has an out parameter. Injection cannot be per... + + + + + The method {0}.{1}({2}) has at least one out parameter. Methods with out... + + + + + The method {0}.{1}({2}) has at least one ref parameter.Methods with ref ... + + + + + The method {1} on type {0} is marked for injection but it is an open gen... + + + + + The method {0}.{1}({2}) is static. Static methods cannot be injected. + + + + + The type {0} is an open generic type. An open generic type cannot be res... + + + + + Resolving parameter "{0}" of constructor {1} + + + + + The parameter {0} could not be resolved when attempting to call construc... + + + + + An attempt to override an existing mapping was detected for type {1} wit... + + + + + The set of assemblies contains a null element. + + + + + Parameter type inference does not work for null values. Indicate the par... + + + + + Calling constructor {0} + + + + + Calling method {0}.{1} + + + + + An item with the given key is already present in the dictionary. + + + + + The lifetime manager is already registered. Lifetime managers cannot be ... + + + + + The override marker build plan policy has been invoked. This should neve... + + + + + Resolving parameter "{0}" of method {1}.{2} + + + + + The value for parameter "{1}" of method {0} could not be resol... + + + + + Could not resolve dependency for build key {0}. + + + + + The type {0} has multiple constructors marked with the InjectionConstruc... + + + + + The supplied type {0} must be an open generic type. + + + + + The supplied type {0} does not have the same number of generic arguments... + + + + + The type {0} does not have an accessible constructor. + + + + + The type {0} does not have a generic argument named "{1}" + + + + + while resolving + + + + + The type {0} does not have a constructor that takes the parameters ({1}). + + + + + The type {0} does not have a public method named {1} that takes the para... + + + + + The type {0} does not contain an instance property named {1}. + + + + + The type {0} is not a generic type and you are attempting to inject a ge... + + + + + The type {0} is not an array type with rank 1 and you are attempting to ... + + + + + Optional dependencies must be reference types. The type {0} is a value t... + + + + + The property {0} on type {1} is not settable. + + + + + The property {0} on type {1} is of type {2} and cannot be injected with ... + + + + + The value for the property "{0}" could not be resolved. + + + + + The provided string argument must not be empty. + + + + + Resolution of the dependency failed type = "{0}" name = "... + + + + + Resolving {0}{1} + + + + + Resolving {0}{1} (mapped from {2} {3}) + + + + + Resolving value for property {0}.{1} + + + + + The constructor {1} selected for type {0} has ref or out parameters. Suc... + + + + + Setting value for property {0}.{1} + + + + + The type {0} cannot be constructed. You must configure the container to ... + + + + + The type {1} cannot be assigned to variables of type {0}. + + + + + <unknown> + + + + + Provides extension methods to the class due to the introduction + of class in the .NET for Windows Store apps. + + + + + Returns the constructor in that matches the specified constructor parameter types. + + The type to inspect + The constructor parameter types. + The constructor that matches the specified parameter types. + + + + Returns the non-static declared methods of a type or its base types. + + The type to inspect + An enumerable of the objects. + + + + Returns the non-static method of a type or its based type. + + The type to inspect + The name of the method to seek. + The (closed) parameter type signature of the method. + The discovered + + + + Returns the declared properties of a type or its base types. + + The type to inspect + An enumerable of the objects. + + + + Determines if the types in a parameter set ordinally matches the set of supplied types. + + + + + + + + This attribute is used to mark properties and parameters as targets for injection. + + + For properties, this attribute is necessary for injection to happen. For parameters, + it's not needed unless you want to specify additional information to control how + the parameter is resolved. + + + + + Base class for attributes that can be placed on parameters + or properties to specify how to resolve the value for + that parameter or property. + + + + + Create an instance of that + will be used to get the value for the member this attribute is + applied to. + + Type of parameter or property that + this attribute is decoration. + The resolver object. + + + + Create an instance of with no name. + + + + + Create an instance of with the given name. + + Name to use when resolving this dependency. + + + + Create an instance of that + will be used to get the value for the member this attribute is + applied to. + + Type of parameter or property that + this attribute is decoration. + The resolver object. + + + + The name specified in the constructor. + + + + + This attribute is used to indicate which constructor to choose when + the container attempts to build a type. + + + + + This attribute is used to mark methods that should be called when + the container is building an object. + + + + + An used to mark a dependency + as optional - the container will try to resolve it, and return null + if the resolution fails rather than throw. + + + + + Construct a new object. + + + + + Construct a new object that + specifies a named dependency. + + Name of the dependency. + + + + Create an instance of that + will be used to get the value for the member this attribute is + applied to. + + Type of parameter or property that + this attribute is decoration. + The resolver object. + + + + Name of the dependency. + + + + + A that composites other + ResolverOverride objects. The GetResolver operation then + returns the resolver from the first child override that + matches the current context and request. + + + + + Base class for all override objects passed in the + method. + + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + Wrap this resolver in one that verifies the type of the object being built. + This allows you to narrow any override down to a specific type easily. + + Type to constrain the override to. + The new override. + + + + Wrap this resolver in one that verifies the type of the object being built. + This allows you to narrow any override down to a specific type easily. + + Type to constrain the override to. + The new override. + + + + Add a new to the collection + that is checked. + + item to add. + + + + Add a setof s to the collection. + + items to add. + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + 2 + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + 1 + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + Class that returns information about the types registered in a container. + + + + + The type that was passed to the method + as the "from" type, or the only type if type mapping wasn't done. + + + + + The type that this registration is mapped to. If no type mapping was done, the + property and this one will have the same value. + + + + + Name the type was registered under. Null for default registration. + + + + + The registered lifetime manager instance. + + + + + The lifetime manager for this registration. + + + This property will be null if this registration is for an open generic. + + + + A class that overrides + the value injected whenever there is a dependency of the + given type, regardless of where it appears in the object graph. + + + + + Create an instance of to override + the given type with the given value. + + Type of the dependency. + Value to use. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + A convenience version of that lets you + specify the dependency type using generic syntax. + + Type of the dependency to override. + + + + Construct a new object that will + override the given dependency, and pass the given value. + + + + + A convenience form of that lets you + specify multiple parameter overrides in one shot rather than having + to construct multiple objects. + + + This class isn't really a collection, it just implements IEnumerable + so that we get use of the nice C# collection initializer syntax. + + + + + Base helper class for creating collections of objects + for use in passing a bunch of them to the resolve call. This base class provides + the mechanics needed to allow you to use the C# collection initializer syntax. + + Concrete type of the this class collects. + Key used to create the underlying override object. + Value that the override returns. + + + + Add a new override to the collection with the given key and value. + + Key - for example, a parameter or property name. + Value - the value to be returned by the override. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + 2 + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + 1 + + + + When implemented in derived classes, this method is called from the + method to create the actual objects. + + Key value to create the resolver. + Value to store in the resolver. + The created . + + + + When implemented in derived classes, this method is called from the + method to create the actual objects. + + Key value to create the resolver. + Value to store in the resolver. + The created . + + + + Event argument class for the event. + + + + + Construct a new object with the + given child container object. + + An for the newly created child + container. + + + + The newly created child container. + + + + + An extension context for the created child container. + + + + + The class provides the means for extension objects + to manipulate the internal state of the . + + + + + Store a type/name pair for later resolution. + + + + When users register type mappings (or other things) with a named key, this method + allows you to register that name with the container so that when the + method is called, that name is included in the list that is returned. + + to register. + Name assocated with that type. + + + + The container that this context is associated with. + + The object. + + + + The strategies this container uses. + + The that the container uses to build objects. + + + + The strategies this container uses to construct build plans. + + The that this container uses when creating + build plans. + + + + The policies this container uses. + + The the that container uses to build objects. + + + + The that this container uses. + + The is used to manage objects that the container is managing. + + + + This event is raised when the method, + or one of its overloads, is called. + + + + + This event is raised when the method, + or one of its overloads, is called. + + + + + This event is raised when the method is called, providing + the newly created child container to extensions to act on as they see fit. + + + + + Base interface for all extension configuration interfaces. + + + + + Retrieve the container instance that we are currently configuring. + + + + + An EventArgs class that holds a string Name. + + + + + Create a new with a null name. + + + + + Create a new with the given name. + + Name to store. + + + + The name. + + Name used for this event arg object. + + + + Event argument class for the event. + + + + + Create a new instance of . + + Type to map from. + Type to map to. + Name for the registration. + to manage instances. + + + + Type to map from. + + + + + Type to map to. + + + + + to manage instances. + + + + + Event argument class for the event. + + + + + Create a default instance. + + + + + Create a instance initialized with the given arguments. + + Type of instance being registered. + The instance object itself. + Name to register under, null if default registration. + object that handles how + the instance will be owned. + + + + Type of instance being registered. + + + Type of instance being registered. + + + + + Instance object being registered. + + Instance object being registered + + + + that controls ownership of + this instance. + + + + + Base class for all extension objects. + + + + + The container calls this method when the extension is added. + + A instance that gives the + extension access to the internals of the container. + + + + Initial the container with this extension's functionality. + + + When overridden in a derived class, this method will modify the given + by adding strategies, policies, etc. to + install it's functions into the container. + + + + Removes the extension's functions from the container. + + + + This method is called when extensions are being removed from the container. It can be + used to do things like disconnect event handlers or clean up member state. You do not + need to remove strategies or policies here; the container will do that automatically. + + + The default implementation of this method does nothing. + + + + + The container this extension has been added to. + + The that this extension has been added to. + + + + The object used to manipulate + the inner state of the container. + + + + + A that lets you specify that + an instance of a generic type parameter should be resolved. + + + + + Base class for subclasses that let you specify that + an instance of a generic type parameter should be resolved. + + + + + Base type for objects that are used to configure parameters for + constructor or method injection, or for getting the value to + be injected into a property. + + + + + Test to see if this parameter value has a matching type for the given type. + + Type to check. + True if this parameter value is compatible with type , + false if not. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + Convert the given set of arbitrary values to a sequence of InjectionParameterValue + objects. The rules are: If it's already an InjectionParameterValue, return it. If + it's a Type, return a ResolvedParameter object for that type. Otherwise return + an InjectionParameter object for that value. + + The values to build the sequence from. + The resulting converted sequence. + + + + Convert an arbitrary value to an InjectionParameterValue object. The rules are: + If it's already an InjectionParameterValue, return it. If it's a Type, return a + ResolvedParameter object for that type. Otherwise return an InjectionParameter + object for that value. + + The value to convert. + The resulting . + + + + Name for the type represented by this . + This may be an actual type name or a generic argument name. + + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + name to use when looking up in the container. + + + + Test to see if this parameter value has a matching type for the given type. + + Type to check. + True if this parameter value is compatible with type , + false if not. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + Return a instance that will + return this types value for the parameter. + + The actual type to resolve. + The resolution key. + The . + + + + Name for the type represented by this . + This may be an actual type name or a generic argument name. + + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + name to use when looking up in the container. + + + + Return a instance that will + return this types value for the parameter. + + The actual type to resolve. + The resolution key. + The . + + + + A that lets you specify that + an array containing the registered instances of a generic type parameter + should be resolved. + + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + The values for the elements, that will + be converted to objects. + + + + Test to see if this parameter value has a matching type for the given type. + + Type to check. + True if this parameter value is compatible with type , + false if not. + A type is considered compatible if it is an array type of rank one + and its element type is a generic type parameter with a name matching this generic + parameter name configured for the receiver. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + Name for the type represented by this . + This may be an actual type name or a generic argument name. + + + + + A Unity container extension that allows you to configure + which constructors, properties, and methods get injected + via an API rather than through attributes. + + + + + Initial the container with this extension's functionality. + + + When overridden in a derived class, this method will modify the given + by adding strategies, policies, etc. to + install it's functions into the container. + + + + API to configure the injection settings for a particular type. + + Type the injection is being configured for. + Objects containing the details on which members to inject and how. + This extension object. + + + + API to configure the injection settings for a particular type/name pair. + + Type the injection is being configured for. + Name of registration + Objects containing the details on which members to inject and how. + This extension object. + + + + API to configure the injection settings for a particular type. + + Type to configure. + Objects containing the details on which members to inject and how. + This extension object. + + + + API to configure the injection settings for a particular type/name pair. + + Type to configure. + Name of registration. + Objects containing the details on which members to inject and how. + This extension object. + + + + API to configure the injection settings for a particular type/name pair. + + Type of interface/base class being registered (may be null). + Type of actual implementation class being registered. + Name of registration. + Objects containing the details on which members to inject and how. + This extension object. + + + + A class that holds the collection of information + for a constructor, so that the container can + be configured to call this constructor. + + + + + Base class for objects that can be used to configure what + class members get injected by the container. + + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Type to register. + Policy list to add policies to. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Type of interface being registered. If no interface, + this will be null. + Type of concrete type being registered. + Name used to resolve the type object. + Policy list to add policies to. + + + + Create a new instance of that looks + for a constructor with the given set of parameters. + + The values for the parameters, that will + be converted to objects. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Interface registered, ignored in this implementation. + Type to register. + Name used to resolve the type object. + Policy list to add policies to. + + + + A class that lets you specify a factory method the container + will use to create the object. + + This is a significantly easier way to do the same + thing the old static factory extension was used for. + + + + Create a new instance of with + the given factory function. + + Factory function. + + + + Create a new instance of with + the given factory function. + + Factory function. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Type of interface being registered. If no interface, + this will be null. This parameter is ignored in this implementation. + Type of concrete type being registered. + Name used to resolve the type object. + Policy list to add policies to. + + + + An that configures the + container to call a method as part of buildup. + + + + + Create a new instance which will configure + the container to call the given methods with the given parameters. + + Name of the method to call. + Parameter values for the method. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Type of interface registered, ignored in this implementation. + Type to register. + Name used to resolve the type object. + Policy list to add policies to. + + + + A small function to handle name matching. You can override this + to do things like case insensitive comparisons. + + MethodInfo for the method you're checking. + Name of the method you're looking for. + True if a match, false if not. + + + + A class that holds on to the given value and provides + the required + when the container is configured. + + + + + A base class for implementing classes + that deal in explicit types. + + + + + Create a new that exposes + information about the given . + + Type of the parameter. + + + + Test to see if this parameter value has a matching type for the given type. + + Type to check. + True if this parameter value is compatible with type , + false if not. + + + + The type of parameter this object represents. + + + + + Name for the type represented by this . + This may be an actual type name or a generic argument name. + + + + + Create an instance of that stores + the given value, using the runtime type of that value as the + type of the parameter. + + Value to be injected for this parameter. + + + + Create an instance of that stores + the given value, associated with the given type. + + Type of the parameter. + Value of the parameter + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + A generic version of that makes it a + little easier to specify the type of the parameter. + + Type of parameter. + + + + Create a new . + + Value for the parameter. + + + + This class stores information about which properties to inject, + and will configure the container accordingly. + + + + + Configure the container to inject the given property name, + resolving the value via the container. + + Name of the property to inject. + + + + Configure the container to inject the given property name, + using the value supplied. This value is converted to an + object using the + rules defined by the + method. + + Name of property to inject. + Value for property. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Interface being registered, ignored in this implemenation. + Type to register. + Name used to resolve the type object. + Policy list to add policies to. + + + + A that lets you specify that + an instance of a generic type parameter should be resolved, providing the + value if resolving fails. + + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + name to use when looking up in the container. + + + + Return a instance that will + return this types value for the parameter. + + The actual type to resolve. + The resolution key. + The . + + + + A that can be passed to + to configure a + parameter or property as an optional dependency. + + + + + Construct a new object that + specifies the given . + + Type of the dependency. + + + + Construct a new object that + specifies the given and . + + Type of the dependency. + Name for the dependency. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + A generic version of that lets you + specify the type of the dependency using generics syntax. + + Type of the dependency. + + + + Construct a new . + + + + + Construct a new with the given + . + + Name of the dependency. + + + + A class that stores a type, and generates a + resolver object that resolves all the named instances or the + type registered in a container. + + + + + Construct a new that + resolves to the given element type and collection of element values. + + The type of elements to resolve. + The values for the elements, that will + be converted to objects. + + + + Construct a new that + resolves to the given array and element types and collection of element values. + + The type for the array of elements to resolve. + The type of elements to resolve. + The values for the elements, that will + be converted to objects. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + A generic version of for convenience + when creating them by hand. + + Type of the elements for the array of the parameter. + + + + Construct a new that + resolves to the given element generic type with the given element values. + + The values for the elements, that will + be converted to objects. + + + + A class that stores a name and type, and generates a + resolver object that resolves the parameter via the + container. + + + + + Construct a new that + resolves to the given type. + + Type of this parameter. + + + + Construct a new that + resolves the given type and name. + + Type of this parameter. + Name to use when resolving parameter. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + A generic version of for convenience + when creating them by hand. + + Type of the parameter + + + + Create a new for the given + generic type and the default name. + + + + + Create a new for the given + generic type and name. + + Name to use to resolve this parameter. + + + + Interface defining the behavior of the Unity dependency injection container. + + + + + Register a type mapping with the container, where the created instances will use + the given . + + that will be requested. + that will actually be returned. + Name to use for registration, null if a default registration. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Name for registration. + + object that controls how this instance will be managed by the container. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Resolve an instance of the requested type with the given name from the container. + + of object to get from the container. + Name of the object to retrieve. + Any overrides for the resolve call. + The retrieved object. + + + + Return instances of all registered types requested. + + + + This method is useful if you've registered multiple types with the same + but different names. + + + Be aware that this method does NOT return an instance for the default (unnamed) registration. + + + The type requested. + Any overrides for the resolve calls. + Set of objects of type . + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + of object to perform injection on. + Instance to build up. + name to use when looking up the typemappings and other configurations. + Any overrides for the resolve calls. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Run an existing object through the container, and clean it up. + + The object to tear down. + + + + Add an extension object to the container. + + to add. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Resolve access to a configuration interface exposed by an extension. + + Extensions can expose configuration interfaces as well as adding + strategies and policies to the container. This method walks the list of + added extensions and returns the first one that implements the requested type. + + of configuration interface required. + The requested extension's configuration interface, or null if not found. + + + + Remove all installed extensions from this container. + + + + This method removes all extensions from the container, including the default ones + that implement the out-of-the-box behavior. After this method, if you want to use + the container again you will need to either readd the default extensions or replace + them with your own. + + + The registered instances and singletons that have already been set up in this container + do not get removed. + + + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Create a child container. + + + A child container shares the parent's configuration, but can be configured with different + settings or lifetime. + The new child container. + + + + The parent of this container. + + The parent container, or null if this container doesn't have one. + + + + Get a sequence of that describe the current state + of the container. + + + + + A that holds onto the instance given to it. + When the is disposed, + the instance is disposed with it. + + + + + Base class for Lifetime managers which need to synchronize calls to + . + + + + The purpose of this class is to provide a basic implementation of the lifetime manager synchronization pattern. + + + Calls to the method of a + instance acquire a lock, and if the instance has not been initialized with a value yet the lock will only be released + when such an initialization takes place by calling the method or if + the build request which resulted in the call to the GetValue method fails. + + + + + + + Base class for Lifetime managers - classes that control how + and when instances are created by the Unity container. + + + + + A that controls how instances are + persisted and recovered from an external store. Used to implement + things like singletons and per-http-request lifetime. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object to store. + + + + Remove the value this lifetime policy is managing from backing store. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + + + + Remove the given object from backing store. + + + + + This interface provides a hook for the builder context to + implement error recovery when a builder strategy throws + an exception. Since we can't get try/finally blocks onto + the call stack for later stages in the chain, we instead + add these objects to the context. If there's an exception, + all the current IRequiresRecovery instances will have + their Recover methods called. + + + + + A method that does whatever is needed to clean up + as part of cleaning up after an exception. + + + Don't do anything that could throw in this method, + it will cause later recover operations to get skipped + and play real havoc with the stack trace. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + Calls to this method acquire a lock which is released only if a non-null value + has been set for the lifetime manager. + + + + Performs the actual retrieval of a value from the backing store associated + with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + This method is invoked by + after it has acquired its lock. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + Setting a value will attempt to release the lock acquired by + . + + + + Performs the actual storage of the given value into backing store for retrieval later. + + The object being stored. + This method is invoked by + before releasing its lock. + + + + Remove the given object from backing store. + + + + + A method that does whatever is needed to clean up + as part of cleaning up after an exception. + + + Don't do anything that could throw in this method, + it will cause later recover operations to get skipped + and play real havoc with the stack trace. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + + + + Remove the given object from backing store. + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + 2 + + + + Standard Dispose pattern implementation. Not needed, but it keeps FxCop happy. + + Always true, since we don't have a finalizer. + + + + A that holds a weak reference to + it's managed instance. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + + + + Remove the given object from backing store. + + + + + A special lifetime manager which works like , + except that in the presence of child containers, each child gets it's own instance + of the object, instead of sharing one in the common parent. + + + + + An implementation of that + creates instances of the type of the given Lifetime Manager + by resolving them through the container. + + + + + A builder policy used to create lifetime policy instances. + Used by the LifetimeStrategy when instantiating open + generic types. + + + + + Create a new instance of . + + The new instance. + + + + The type of Lifetime manager that will be created by this factory. + + + + + Create a new that will + return instances of the given type, creating them by + resolving through the container. + + Container to resolve with. + Type of LifetimeManager to create. + + + + Create a new instance of . + + The new instance. + + + + The type of Lifetime manager that will be created by this factory. + + + + + This is a custom lifetime manager that acts like , + but also provides a signal to the default build plan, marking the type so that + instances are reused across the build up object graph. + + + + + Construct a new object that does not + itself manage an instance. + + + + + Construct a new object that stores the + give value. This value will be returned by + but is not stored in the lifetime manager, nor is the value disposed. + This Lifetime manager is intended only for internal use, which is why the + normal method is not used here. + + Value to store. + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. In this class, + this is a noop, since it has special hooks down in the guts. + + The object being stored. + + + + Remove the given object from backing store. Noop in this class. + + + + + An implementation that does nothing, + thus ensuring that instances are created new every time. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + + + + Remove the given object from backing store. + + + + + This strategy implements the logic that will call container.ResolveAll + when an array parameter is detected. + + + + + Do the PreBuildUp stage of construction. This is where the actual work is performed. + + Current build context. + + + + An implementation of that is + aware of the build keys used by the Unity container. + + + + + Base class that provides an implementation of + which lets you override how the parameter resolvers are created. + + + + + A that, when implemented, + will determine which constructor to call from the build plan. + + + + + Choose the constructor to call for the given type. + + Current build context + The to add any + generated resolver objects into. + The chosen constructor. + + + + Choose the constructor to call for the given type. + + Current build context + The to add any + generated resolver objects into. + The chosen constructor. + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. + + + + Value Condition Less than zerox is less than y.Zerox equals y.Greater than zerox is greater than y. + + + The second object to compare. + The first object to compare. + + + + Create a instance for the given + . + + + This implementation looks for the Unity on the + parameter and uses it to create an instance of + for this parameter. + Parameter to create the resolver for. + The resolver object. + + + + An implementation of that is aware + of the build keys used by the Unity container. + + + + + Base class that provides an implementation of + which lets you override how the parameter resolvers are created. + + Attribute that marks methods that should + be called. + + + + An that will examine the given + types and return a sequence of objects + that should be called as part of building the object. + + + + + Return the sequence of methods to call while building the target object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of methods to call. + + + + Return the sequence of methods to call while building the target object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of methods to call. + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + An implementation of that is aware of + the build keys used by the unity container. + + + + + Base class that provides an implementation of + which lets you override how the parameter resolvers are created. + + + + + An that returns a sequence + of properties that should be injected for the given type. + + + + + Returns sequence of properties on the given type that + should be set as part of building that object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of objects + that contain the properties to set. + + + + Returns sequence of properties on the given type that + should be set as part of building that object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of objects + that contain the properties to set. + + + + Create a for the given + property. + + Property to create resolver for. + The resolver object. + + + + Create a for the given + property. + + Property to create resolver for. + The resolver object. + + + + A strategy that handles Hierarchical lifetimes across a set of parent/child + containers. + + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + A implementation that returns + the value set in the constructor. + + + + + A that is used at build plan execution time + to resolve a dependent value. + + + + + Get the value for a dependency. + + Current build context. + The value for the dependency. + + + + Create a new instance of + which will return the given value when resolved. + + The value to return. + + + + Get the value for a dependency. + + Current build context. + The value for the dependency. + + + + An implementation of that stores a + type and name, and at resolution time puts them together into a + . + + + + + Create an instance of + with the given type and name. + + The type. + The name (may be null). + + + + Resolve the value for a dependency. + + Current build context. + The value for the dependency. + + + + The type that this resolver resolves. + + + + + The name that this resolver resolves. + + + + + A that will attempt to + resolve a value, and return null if it cannot rather than throwing. + + + + + Construct a new object + that will attempt to resolve the given name and type from the container. + + Type to resolve. Must be a reference type. + Name to resolve with. + + + + Construct a new object + that will attempt to resolve the given type from the container. + + Type to resolve. Must be a reference type. + + + + Get the value for a dependency. + + Current build context. + The value for the dependency. + + + + Type this resolver will resolve. + + + + + Name this resolver will resolve. + + + + + An implementation of that resolves to + to an array populated with the values that result from resolving other instances + of . + + + + + Create an instance of + with the given type and a collection of + instances to use when populating the result. + + The type. + The resolver policies to use when populating an array. + + + + Resolve the value for a dependency. + + Current build context. + An array pupulated with the results of resolving the resolver policies. + + + + An implementation of that selects + the given constructor and creates the appropriate resolvers to call it with + the specified parameters. + + + + + Create an instance of that + will return the given constructor, being passed the given injection values + as parameters. + + The constructor to call. + Set of objects + that describes how to obtain the values for the constructor parameters. + + + + Choose the constructor to call for the given type. + + Current build context + The to add any + generated resolver objects into. + The chosen constructor. + + + + Helper class for implementing selector policies that need to + set up dependency resolver policies. + + + + + Add dependency resolvers to the parameter set. + + Type that's currently being built (used to resolve open generics). + PolicyList to add the resolvers to. + Objects supplying the dependency resolvers. + Result object to store the keys in. + + + + A implementation that calls the specific + methods with the given parameters. + + + + + Add the given method and parameter collection to the list of methods + that will be returned when the selector's + method is called. + + Method to call. + sequence of objects + that describe how to create the method parameter values. + + + + Return the sequence of methods to call while building the target object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of methods to call. + + + + An implemnetation of which returns + the set of specific properties that the selector was configured with. + + + + + Add a property that will be par of the set returned when the + is called. + + The property to set. + object describing + how to create the value to inject. + + + + Returns sequence of properties on the given type that + should be set as part of building that object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of objects + that contain the properties to set. + + + + The build stages we use in the Unity container + strategy pipeline. + + + + + First stage. By default, nothing happens here. + + + + + Second stage. Type mapping occurs here. + + + + + Third stage. lifetime managers are checked here, + and if they're available the rest of the pipeline is skipped. + + + + + Fourth stage. Reflection over constructors, properties, etc. is + performed here. + + + + + Fifth stage. Instance creation happens here. + + + + + Sixth stage. Property sets and method injection happens here. + + + + + Seventh and final stage. By default, nothing happens here. + + + + + Represents the context in which a build-up or tear-down operation runs. + + + + + Represents the context in which a build-up or tear-down operation runs. + + + + + Add a new set of resolver override objects to the current build operation. + + objects to add. + + + + Get a object for the given + or null if that dependency hasn't been overridden. + + Type of the dependency. + Resolver to use, or null if no override matches for the current operation. + + + + A convenience method to do a new buildup operation on an existing context. + + Key to use to build up. + Created object. + + + + A convenience method to do a new buildup operation on an existing context. This + overload allows you to specify extra policies which will be in effect for the duration + of the build. + + Key defining what to build up. + A delegate that takes a . This + is invoked with the new child context before the build up process starts. This gives callers + the opportunity to customize the context for the build process. + Created object. + + + + Gets the head of the strategy chain. + + + The strategy that's first in the chain; returns null if there are no + strategies in the chain. + + + + + Gets the associated with the build. + + + The associated with the build. + + + + + Gets the original build key for the build operation. + + + The original build key for the build operation. + + + + + Get the current build key for the current build operation. + + + + + The set of policies that were passed into this context. + + This returns the policies passed into the context. + Policies added here will remain after buildup completes. + The persistent policies for the current context. + + + + Gets the policies for the current context. + + Any policies added to this object are transient + and will be erased at the end of the buildup. + + The policies for the current context. + + + + + Gets the collection of objects + that need to execute in event of an exception. + + + + + The current object being built up or torn down. + + + The current object being manipulated by the build operation. May + be null if the object hasn't been created yet. + + + + Flag indicating if the build operation should continue. + + true means that building should not call any more + strategies, false means continue to the next strategy. + + + + An object representing what is currently being done in the + build chain. Used to report back errors if there's a failure. + + + + + The build context used to resolve a dependency during the build operation represented by this context. + + + + + Initialize a new instance of the class. + + + + + Initialize a new instance of the class with a , + , and the + build key used to start this build operation. + + The to use for this context. + The to use for this context. + The to use for this context. + Build key to start building. + The existing object to build up. + + + + Create a new using the explicitly provided + values. + + The to use for this context. + The to use for this context. + The set of persistent policies to use for this context. + The set of transient policies to use for this context. It is + the caller's responsibility to ensure that the transient and persistent policies are properly + combined. + Build key for this context. + Existing object to build up. + + + + Add a new set of resolver override objects to the current build operation. + + objects to add. + + + + Get a object for the given + or null if that dependency hasn't been overridden. + + Type of the dependency. + Resolver to use, or null if no override matches for the current operation. + + + + A convenience method to do a new buildup operation on an existing context. + + Key to use to build up. + Created object. + + + + A convenience method to do a new buildup operation on an existing context. This + overload allows you to specify extra policies which will be in effect for the duration + of the build. + + Key defining what to build up. + A delegate that takes a . This + is invoked with the new child context before the build up process starts. This gives callers + the opportunity to customize the context for the build process. + Created object. + + + + Gets the head of the strategy chain. + + + The strategy that's first in the chain; returns null if there are no + strategies in the chain. + + + + + Get the current build key for the current build operation. + + + + + The current object being built up or torn down. + + + The current object being manipulated by the build operation. May + be null if the object hasn't been created yet. + + + + Gets the associated with the build. + + + The associated with the build. + + + + + Gets the original build key for the build operation. + + + The original build key for the build operation. + + + + + The set of policies that were passed into this context. + + This returns the policies passed into the context. + Policies added here will remain after buildup completes. + The persistent policies for the current context. + + + + Gets the policies for the current context. + + + Any modifications will be transient (meaning, they will be forgotten when + the outer BuildUp for this context is finished executing). + + + The policies for the current context. + + + + + Gets the collection of objects + that need to execute in event of an exception. + + + + + Flag indicating if the build operation should continue. + + true means that building should not call any more + strategies, false means continue to the next strategy. + + + + An object representing what is currently being done in the + build chain. Used to report back errors if there's a failure. + + + + + The build context used to resolve a dependency during the build operation represented by this context. + + + + + Represents that a dependency could not be resolved. + + + + + Initializes a new instance of the class with no extra information. + + + + + Initializes a new instance of the class with the given message. + + Some random message. + + + + Initialize a new instance of the class with the given + message and inner exception. + + Some random message + Inner exception. + + + + Initializes a new instance of the class with the build key of the object begin built. + + The build key of the object begin built. + + + + The exception thrown when injection is attempted on a method + that is an open generic or has out or ref params. + + + + + Construct a new with no + message. + + + + + Construct a with the given message + + Message to return. + + + + Construct a with the given message + and inner exception. + + Message to return. + Inner exception + + + + Extension methods to provide convenience overloads over the + interface. + + + + + Start a recursive build up operation to retrieve the default + value for the given type. + + Type of object to build. + Parent context. + Resulting object. + + + + Start a recursive build up operation to retrieve the named + implementation for the given type. + + Type to resolve. + Parent context. + Name to resolve with. + The resulting object. + + + + Add a set of s to the context, specified as a + variable argument list. + + Context to add overrides to. + The overrides. + + + + Data structure that stores the set of + objects and executes them when requested. + + + + + Add a new object to this + list. + + Object to add. + + + + Execute the method + of everything in the recovery list. Recoveries will execute + in the opposite order of add - it's a stack. + + + + + Return the number of recovery objects currently in the stack. + + + + + Represents a lifetime container. + + + A lifetime container tracks the lifetime of an object, and implements + IDisposable. When the container is disposed, any objects in the + container which implement IDisposable are also disposed. + + + + + Adds an object to the lifetime container. + + The item to be added to the lifetime container. + + + + Determine if a given object is in the lifetime container. + + + The item to locate in the lifetime container. + + + Returns true if the object is contained in the lifetime + container; returns false otherwise. + + + + + Removes an item from the lifetime container. The item is + not disposed. + + The item to be removed. + + + + Gets the number of references in the lifetime container + + + The number of references in the lifetime container + + + + + Represents a lifetime container. + + + A lifetime container tracks the lifetime of an object, and implements + IDisposable. When the container is disposed, any objects in the + container which implement IDisposable are also disposed. + + + + + Adds an object to the lifetime container. + + The item to be added to the lifetime container. + + + + Determine if a given object is in the lifetime container. + + + The item to locate in the lifetime container. + + + Returns true if the object is contained in the lifetime + container; returns false otherwise. + + + + + Releases the resources used by the . + + + + + Releases the managed resources used by the DbDataReader and optionally releases the unmanaged resources. + + + true to release managed and unmanaged resources; false to release only unmanaged resources. + + + + + Returns an enumerator that iterates through the lifetime container. + + + An object that can be used to iterate through the life time container. + + + + + Returns an enumerator that iterates through the lifetime container. + + + An object that can be used to iterate through the life time container. + + + + + Removes an item from the lifetime container. The item is + not disposed. + + The item to be removed. + + + + Gets the number of references in the lifetime container + + + The number of references in the lifetime container + + + + + A custom collection over objects. + + + + + Removes an individual policy type for a build key. + + The type of policy to remove. + The key the policy applies. + + + + Removes all policies from the list. + + + + + Removes a default policy. + + The type the policy was registered as. + + + + Gets an individual policy. + + The interface the policy is registered under. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy list in the chain that the searched for policy was found in, null if the policy was + not found. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + The interface the policy is registered under. + The key the policy applies to. + True if the search should be in the local policy list only; otherwise false to search up the parent chain. + The policy list in the chain that the searched for policy was found in, null if the policy was + not found. + The policy in the list if present; returns null otherwise. + + + + Sets an individual policy. + + The of the policy. + The policy to be registered. + The key the policy applies. + + + + Sets a default policy. When checking for a policy, if no specific individual policy + is available, the default will be used. + + The interface to register the policy under. + The default policy to be registered. + + + + A custom collection wrapper over objects. + + + + + Initialize a new instance of a class. + + + + + Initialize a new instance of a class with another policy list. + + An inner policy list to search. + + + + Removes an individual policy type for a build key. + + The type of policy to remove. + The key the policy applies. + + + + Removes all policies from the list. + + + + + Removes a default policy. + + The type the policy was registered as. + + + + Gets an individual policy. + + The interface the policy is registered under. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy list in the chain that the searched for policy was found in, null if the policy was + not found. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + The interface the policy is registered under. + The key the policy applies to. + True if the search should be in the local policy list only; otherwise false to search up the parent chain. + The policy list in the chain that the searched for policy was found in, null if the policy was + not found. + The policy in the list if present; returns null otherwise. + + + + Sets an individual policy. + + The of the policy. + The policy to be registered. + The key the policy applies. + + + + Sets a default policy. When checking for a policy, if no specific individual policy + is available, the default will be used. + + The interface to register the policy under. + The default policy to be registered. + + + + Gets the number of items in the locator. + + + The number of items in the locator. + + + + + Extension methods on to provide convenience + overloads (generic versions, mostly). + + + + + Removes an individual policy type for a build key. + + The type the policy was registered as. + to remove the policy from. + The key the policy applies. + + + + Removes a default policy. + + The type the policy was registered as. + to remove the policy from. + + + + Gets an individual policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + The policy list that actually contains the returned policy. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + to search. + The interface the policy is registered under. + The key the policy applies. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + to search. + The interface the policy is registered under. + The key the policy applies. + The policy list that actually contains the returned policy. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy list that actually contains the returned policy. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + to search. + The interface the policy is registered under. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy list that actually contains the returned policy. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + to search. + The interface the policy is registered under. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy in the list, if present; returns null otherwise. + + + + Sets an individual policy. + + The interface the policy is registered under. + to add the policy to. + The policy to be registered. + The key the policy applies. + + + + Sets a default policy. When checking for a policy, if no specific individual policy + is available, the default will be used. + + The interface to register the policy under. + to add the policy to. + The default policy to be registered. + + + + An implementation of . + + + + + Add a new object to this + list. + + Object to add. + + + + Execute the method + of everything in the recovery list. Recoveries will execute + in the opposite order of add - it's a stack. + + + + + Return the number of recovery objects currently in the stack. + + + + + Implementation of which will notify an object about + the completion of a BuildUp operation, or start of a TearDown operation. + + + This strategy checks the object that is passing through the builder chain to see if it + implements IBuilderAware and if it does, it will call + and . This strategy is meant to be used from the + stage. + + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + Called during the chain of responsibility for a teardown operation. The + PreTearDown method is called when the chain is being executed in the + forward direction. + + Context of the teardown operation. + + + + Implemented on a class when it wants to receive notifications + about the build process. + + + + + Called by the when the object is being built up. + + The key of the object that was just built up. + + + + Called by the when the object is being torn down. + + + + + Enumeration to represent the object builder stages. + + + The order of the values in the enumeration is the order in which the stages are run. + + + + + Strategies in this stage run before creation. Typical work done in this stage might + include strategies that use reflection to set policies into the context that other + strategies would later use. + + + + + Strategies in this stage create objects. Typically you will only have a single policy-driven + creation strategy in this stage. + + + + + Strategies in this stage work on created objects. Typical work done in this stage might + include setter injection and method calls. + + + + + Strategies in this stage work on objects that are already initialized. Typical work done in + this stage might include looking to see if the object implements some notification interface + to discover when its initialization stage has been completed. + + + + + Represents a builder policy for mapping build keys. + + + + + Represents a builder policy for mapping build keys. + + + + + Maps the build key. + + The build key to map. + Current build context. Used for contextual information + if writing a more sophisticated mapping. This parameter can be null + (called when getting container registrations). + The new build key. + + + + Initialize a new instance of the with the new build key. + + The new build key. + + + + Maps the build key. + + The build key to map. + Current build context. Used for contextual information + if writing a more sophisticated mapping, unused in this implementation. + The new build key. + + + + Represents a strategy for mapping build keys in the build up operation. + + + + + Called during the chain of responsibility for a build operation. Looks for the + and if found maps the build key for the current operation. + + The context for the operation. + + + + An implementation of that can map + generic types. + + + + + Create a new instance + that will map generic types. + + Build key to map to. This must be or contain an open generic type. + + + + Maps the build key. + + The build key to map. + Current build context. Used for contextual information + if writing a more sophisticated mapping. + The new build key. + + + + Base class for the current operation stored in the build context. + + + + + Create a new . + + Type currently being built. + + + + The type that's currently being built. + + + + + A that will look for a build plan + in the current context. If it exists, it invokes it, otherwise + it creates one and stores it for later, and invokes it. + + + + + Called during the chain of responsibility for a build operation. + + The context for the operation. + + + + An implementation of that chooses + constructors based on these criteria: first, pick a constructor marked with the + attribute. If there + isn't one, then choose the constructor with the longest parameter list. If that is ambiguous, + then throw. + + Thrown when the constructor to choose is ambiguous. + Attribute used to mark the constructor to call. + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + Objects of this type are the return value from . + It encapsulates the desired with the string keys + needed to look up the for each + parameter. + + + + + Base class for return values from selector policies that + return a memberinfo of some sort plus a list of parameter + keys to look up the parameter resolvers. + + + + + Base class for return of selector policies that need + to keep track of a set of parameter keys. + + + + + Add a new parameter key to this object. Keys are assumed + to be in the order of the parameters to the constructor. + + Key for the next parameter to look up. + + + + The set of keys for the constructor parameters. + + + + + Construct a new , storing + the given member info. + + Member info to store. + + + + The member info stored. + + + + + Create a new instance which + contains the given constructor. + + The constructor to wrap. + + + + The constructor this object wraps. + + + + + This class records the information about which constructor argument is currently + being resolved, and is responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + The type that is being constructed. + A string representing the constructor being called. + Parameter being resolved. + + + + Generate the string describing what parameter was being resolved. + + The description string. + + + + String describing the constructor being set up. + + + + + Parameter that's being resolved. + + + + + A class that records that a constructor is about to be call, and is + responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + + + + Generate the description string. + + The string. + + + + Constructor we're trying to call. + + + + + A class that records that a constructor is about to be call, and is + responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + + + + Generate the description string. + + The string. + + + + Method we're trying to call. + + + + + This class records the information about which constructor argument is currently + being resolved, and is responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + The type that is being constructed. + A string representing the method being called. + Parameter being resolved. + + + + Generate the string describing what parameter was being resolved. + + The description string. + + + + String describing the method being set up. + + + + + Parameter that's being resolved. + + + + + A base class that holds the information shared by all operations + performed by the container while setting properties. + + + + + Initializes a new instance of the class. + + + + + Generate the description of this operation. + + The string. + + + + Get a format string used to create the description. Called by + the base method. + + The format string. + + + + The property value currently being resolved. + + + + + This class records the information about which property value is currently + being resolved, and is responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + + + + Get a format string used to create the description. Called by + the base method. + + The format string. + + + + This class records the information about which property value is currently + being set, and is responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + Type property is on. + Name of property being set. + + + + Get a format string used to create the description. Called by + the base method. + + The format string. + + + + Build plan for that will + return a func that will resolve the requested type + through this container later. + + + + + Creates an instance of this build plan's type, or fills + in the existing type if passed in. + + Context used to build up the object. + + + + An implementation of that selects + methods by looking for the given + attribute on those methods. + + Type of attribute used to mark methods + to inject. + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + Objects of this type are the return value from . + It encapsulates the desired with the string keys + needed to look up the for each + parameter. + + + + + Create a new instance which + contains the given method. + + The method + + + + The constructor this object wraps. + + + + + Creates an instance of this build plan's type, or fills + in the existing type if passed in. + + Context used to build up the object. + + + + An implementation of that looks + for properties marked with the + attribute that are also settable and not indexers. + + + + + + Create a for the given + property. + + Property to create resolver for. + The resolver object. + + + + Objects of this type are returned from + . + This class combines the about + the property with the string key used to look up the resolver + for this property's value. + + + + + Create an instance of + with the given and key. + + The property. + Key to use to look up the resolver. + + + + PropertyInfo for this property. + + + + + Key to look up this property's resolver. + + + + + Implementation of . + + + + + A builder policy that lets you keep track of the current + resolvers and will remove them from the given policy set. + + + + + Add a new resolver to track by key. + + Key that was used to add the resolver to the policy set. + + + + Remove the currently tracked resolvers from the given policy list. + + Policy list to remove the resolvers from. + + + + Add a new resolver to track by key. + + Key that was used to add the resolver to the policy set. + + + + Remove the currently tracked resolvers from the given policy list. + + Policy list to remove the resolvers from. + + + + Get an instance that implements , + either the current one in the policy set or creating a new one if it doesn't + exist. + + Policy list to look up from. + Build key to track. + The resolver tracker. + + + + Add a key to be tracked to the current tracker. + + Policy list containing the resolvers and trackers. + Build key for the resolvers being tracked. + Key for the resolver. + + + + Remove the resolvers for the given build key. + + Policy list containing the build key. + Build key. + + + + An implementation of that + calls back into the build chain to build up the dependency, passing + a type given at compile time as its build key. + + + + + Create a new instance storing the given type. + + Type to resolve. + + + + Get the value for a dependency. + + Current build context. + The value for the dependency. + + + + This interface defines a standard method to convert any + regardless + of the stage enum into a regular, flat strategy chain. + + + + + Convert this into + a flat . + + The flattened . + + + + Represents a chain of responsibility for builder strategies. + + + + + Reverse the order of the strategy chain. + + The reversed strategy chain. + + + + Execute this strategy chain against the given context, + calling the Buildup methods on the strategies. + + Context for the build process. + The build up object + + + + Execute this strategy chain against the given context, + calling the TearDown methods on the strategies. + + Context for the teardown process. + + + + An implementation that uses + a to figure out if an object + has already been created and to update or remove that + object from some backing store. + + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + Called during the chain of responsibility for a build operation. The + PostBuildUp method is called when the chain has finished the PreBuildUp + phase and executes in reverse order from the PreBuildUp calls. + + Context of the build operation. + + + + Represents a chain of responsibility for builder strategies partitioned by stages. + + The stage enumeration to partition the strategies. + + + + Initialize a new instance of the class. + + + + + Initialize a new instance of the class with an inner strategy chain to use when building. + + The inner strategy chain to use first when finding strategies in the build operation. + + + + Adds a strategy to the chain at a particular stage. + + The strategy to add to the chain. + The stage to add the strategy. + + + + Add a new strategy for the . + + The of + The stage to add the strategy. + + + + Clear the current strategy chain list. + + + This will not clear the inner strategy chain if this instane was created with one. + + + + + Makes a strategy chain based on this instance. + + A new . + + + + Represents a chain of responsibility for builder strategies. + + + + + Initialzie a new instance of the class. + + + + + Initialzie a new instance of the class with a colleciton of strategies. + + A collection of strategies to initialize the chain. + + + + Adds a strategy to the chain. + + The strategy to add to the chain. + + + + Adds strategies to the chain. + + The strategies to add to the chain. + + + + Reverse the order of the strategy chain. + + The reversed strategy chain. + + + + Execute this strategy chain against the given context to build up. + + Context for the build processes. + The build up object + + + + Execute this strategy chain against the given context, + calling the TearDown methods on the strategies. + + Context for the teardown process. + + + + Returns an enumerator that iterates through the collection. + + + + A that can be used to iterate through the collection. + + 1 + + + + Returns an enumerator that iterates through a collection. + + + + An object that can be used to iterate through the collection. + + 2 + + + + The almost inevitable collection of extra helper methods on + to augment the rich set of what + Linq already gives us. + + + + + Execute the provided on every item in . + + Type of the items stored in + Sequence of items to process. + Code to run over each item. + + + + Create a single string from a sequenc of items, separated by the provided , + and with the conversion to string done by the given . + + This method does basically the same thing as , + but will work on any sequence of items, not just arrays. + Type of items in the sequence. + Sequence of items to convert. + Separator to place between the items in the string. + The conversion function to change TItem -> string. + The resulting string. + + + + Create a single string from a sequenc of items, separated by the provided , + and with the conversion to string done by the item's method. + + This method does basically the same thing as , + but will work on any sequence of items, not just arrays. + Type of items in the sequence. + Sequence of items to convert. + Separator to place between the items in the string. + The resulting string. + + + + Build key used to combine a type object with a string name. Used by + ObjectBuilder to indicate exactly what is being built. + + + + + Create a new instance with the given + type and name. + + to build. + Key to use to look up type mappings and singletons. + + + + Create a new instance for the default + buildup of the given type. + + to build. + + + + This helper method creates a new instance. It is + initialized for the default key for the given type. + + Type to build. + A new instance. + + + + This helper method creates a new instance for + the given type and key. + + Type to build + Key to use to look up type mappings and singletons. + A new instance initialized with the given type and name. + + + + Compare two instances. + + Two instances compare equal + if they contain the same name and the same type. Also, comparing + against a different type will also return false. + Object to compare to. + True if the two keys are equal, false if not. + + + + Calculate a hash code for this instance. + + A hash code. + + + + Compare two instances for equality. + + Two instances compare equal + if they contain the same name and the same type. + First of the two keys to compare. + Second of the two keys to compare. + True if the values of the keys are the same, else false. + + + + Compare two instances for inequality. + + Two instances compare equal + if they contain the same name and the same type. If either field differs + the keys are not equal. + First of the two keys to compare. + Second of the two keys to compare. + false if the values of the keys are the same, else true. + + + + Formats the build key as a string (primarily for debugging). + + A readable string representation of the build key. + + + + Return the stored in this build key. + + The type to build. + + + + Returns the name stored in this build key. + + The name to use when building. + + + + A generic version of so that + you can new up a key using generic syntax. + + Type for the key. + + + + Construct a new that + specifies the given type. + + + + + Construct a new that + specifies the given type and name. + + Name for the key. + + + + A series of helper methods to deal with sequences - + objects that implement . + + + + + A function that turns an arbitrary parameter list into an + . + + Type of arguments. + The items to put into the collection. + An array that contains the values of the . + + + + Given two sequences, return a new sequence containing the corresponding values + from each one. + + Type of first sequence. + Type of second sequence. + First sequence of items. + Second sequence of items. + New sequence of pairs. This sequence ends when the shorter of sequence1 and sequence2 does. + + + + A class that lets you + override a named parameter passed to a constructor. + + + + + Construct a new object that will + override the given named constructor parameter, and pass the given + value. + + Name of the constructor parameter. + Value to pass for the constructor. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + A convenience form of that lets you + specify multiple parameter overrides in one shot rather than having + to construct multiple objects. + + + + + When implemented in derived classes, this method is called from the + method to create the actual objects. + + Key value to create the resolver. + Value to store in the resolver. + The created . + + + + A that lets you override + the value for a specified property. + + + + + Create an instance of . + + The property name. + Value to use for the property. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + A convenience form of that lets you + specify multiple property overrides in one shot rather than having + to construct multiple objects. + + + + + When implemented in derived classes, this method is called from the + method to create the actual objects. + + Key value to create the resolver. + Value to store in the resolver. + The created . + + + + The exception thrown by the Unity container when + an attempt to resolve a dependency fails. + + + + + Create a new that records + the exception for the given type and name. + + Type requested from the container. + Name requested from the container. + The actual exception that caused the failure of the build. + The build context representing the failed operation. + + + + The type that was being requested from the container at the time of failure. + + + + + The name that was being requested from the container at the time of failure. + + + + + Interface defining the configuration interface exposed by the + Static Factory extension. + + + + + Register the given factory delegate to be called when the container is + asked to resolve . + + Type that will be requested from the container. + Delegate to invoke to create the instance. + The container extension object this method was invoked on. + + + + Register the given factory delegate to be called when the container is + asked to resolve and . + + Type that will be requested from the container. + The name that will be used when requesting to resolve this type. + Delegate to invoke to create the instance. + The container extension object this method was invoked on. + + + + A that lets you register a + delegate with the container to create an object, rather than calling + the object's constructor. + + + + + Initialize this extension. This particular extension requires no + initialization work. + + + + + Register the given factory delegate to be called when the container is + asked to resolve and . + + Type that will be requested from the container. + The name that will be used when requesting to resolve this type. + Delegate to invoke to create the instance. + The container extension object this method was invoked on. + + + + Register the given factory delegate to be called when the container is + asked to resolve . + + Type that will be requested from the container. + Delegate to invoke to create the instance. + The container extension object this method was invoked on. + + + + An implementation of that + acts as a decorator over another . + This checks to see if the current type being built is the + right one before checking the inner . + + + + + Create an instance of + + Type to check for. + Inner override to check after type matches. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + A convenience version of that lets you + specify the type to construct via generics syntax. + + Type to check for. + + + + Create an instance of . + + Inner override to check after type matches. + + + + A simple, extensible dependency injection container. + + + + + Create a default . + + + + + Create a with the given parent container. + + The parent . The current object + will apply its own settings first, and then check the parent for additional ones. + + + + RegisterType a type mapping with the container, where the created instances will use + the given . + + that will be requested. + that will actually be returned. + Name to use for registration, null if a default registration. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + RegisterType an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Name for registration. + + If true, the container will take over the lifetime of the instance, + calling Dispose on it (if it's ) when the container is Disposed. + + If false, container will not maintain a strong reference to . User is reponsible + for disposing instance, and for keeping the instance from being garbage collected. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Get an instance of the requested type with the given name from the container. + + of object to get from the container. + Name of the object to retrieve. + Any overrides for the resolve call. + The retrieved object. + + + + Return instances of all registered types requested. + + + + This method is useful if you've registered multiple types with the same + but different names. + + + Be aware that this method does NOT return an instance for the default (unnamed) registration. + + + The type requested. + Any overrides for the resolve calls. + Set of objects of type . + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + of object to perform injection on. + Instance to build up. + name to use when looking up the typemappings and other configurations. + Any overrides for the buildup. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Run an existing object through the container, and clean it up. + + The object to tear down. + + + + Add an extension object to the container. + + to add. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Get access to a configuration interface exposed by an extension. + + Extensions can expose configuration interfaces as well as adding + strategies and policies to the container. This method walks the list of + added extensions and returns the first one that implements the requested type. + + of configuration interface required. + The requested extension's configuration interface, or null if not found. + + + + Remove all installed extensions from this container. + + + + This method removes all extensions from the container, including the default ones + that implement the out-of-the-box behavior. After this method, if you want to use + the container again you will need to either readd the default extensions or replace + them with your own. + + + The registered instances and singletons that have already been set up in this container + do not get removed. + + + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Create a child container. + + + A child container shares the parent's configuration, but can be configured with different + settings or lifetime. + The new child container. + + + + Dispose this container instance. + + + Disposing the container also disposes any child containers, + and disposes any instances whose lifetimes are managed + by the container. + + + + + Dispose this container instance. + + + This class doesn't have a finalizer, so will always be true. + True if being called from the IDisposable.Dispose + method, false if being called from a finalizer. + + + + Remove policies associated with building this type. This removes the + compiled build plan so that it can be rebuilt with the new settings + the next time this type is resolved. + + Type of object to clear the plan for. + Name the object is being registered with. + + + + The parent of this container. + + The parent container, or null if this container doesn't have one. + + + + Get a sequence of that describe the current state + of the container. + + + + + Implementation of the ExtensionContext that is actually used + by the UnityContainer implementation. + + + This is a nested class so that it can access state in the + container that would otherwise be inaccessible. + + + + + This event is raised when the method, + or one of its overloads, is called. + + + + + Extension class that adds a set of convenience overloads to the + interface. + + + + + Register a type with specific members to be injected. + + Type this registration is for. + Container to configure. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container. + + + + This method is used to tell the container that when asked for type , + actually return an instance of type . This is very useful for + getting instances of interfaces. + + + This overload registers a default mapping and transient lifetime. + + + that will be requested. + that will actually be returned. + Container to configure. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container, where the created instances will use + the given . + + that will be requested. + that will actually be returned. + Container to configure. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container. + + + This method is used to tell the container that when asked for type , + actually return an instance of type . This is very useful for + getting instances of interfaces. + + that will be requested. + that will actually be returned. + Container to configure. + Name of this mapping. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container, where the created instances will use + the given . + + that will be requested. + that will actually be returned. + Container to configure. + Name to use for registration, null if a default registration. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type with the container. + No type mapping is performed for this type. + + The type to apply the to. + Container to configure. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type with the container. + No type mapping is performed for this type. + + The type to configure injection on. + Container to configure. + Name that will be used to request the type. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type and name with the container. + No type mapping is performed for this type. + + The type to apply the to. + Container to configure. + Name that will be used to request the type. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type with specific members to be injected. + + Container to configure. + Type this registration is for. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container. + + + + This method is used to tell the container that when asked for type , + actually return an instance of type . This is very useful for + getting instances of interfaces. + + + This overload registers a default mapping. + + + Container to configure. + that will be requested. + that will actually be returned. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container. + + + This method is used to tell the container that when asked for type , + actually return an instance of type . This is very useful for + getting instances of interfaces. + + Container to configure. + that will be requested. + that will actually be returned. + Name to use for registration, null if a default registration. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container, where the created instances will use + the given . + + Container to configure. + that will be requested. + that will actually be returned. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type and name with the container. + No type mapping is performed for this type. + + Container to configure. + The to apply the to. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type and name with the container. + No type mapping is performed for this type. + + Container to configure. + The to configure in the container. + Name to use for registration, null if a default registration. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type and name with the container. + No type mapping is performed for this type. + + Container to configure. + The to apply the to. + Name to use for registration, null if a default registration. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload does a default registration and has the container take over the lifetime of the instance. + + Type of instance to register (may be an implemented interface instead of the full type). + Container to configure. + Object to returned. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload does a default registration (name = null). + + + Type of instance to register (may be an implemented interface instead of the full type). + Container to configure. + Object to returned. + + object that controls how this instance will be managed by the container. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload automatically has the container take ownership of the . + + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Container to configure. + Name for registration. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Container to configure. + Name for registration. + + object that controls how this instance will be managed by the container. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload does a default registration and has the container take over the lifetime of the instance. + + Container to configure. + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload does a default registration (name = null). + + + Container to configure. + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + + object that controls how this instance will be managed by the container. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload automatically has the container take ownership of the . + + Container to configure. + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Name for registration. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Resolve an instance of the default requested type from the container. + + of object to get from the container. + Container to resolve from. + Any overrides for the resolve call. + The retrieved object. + + + + Resolve an instance of the requested type with the given name from the container. + + of object to get from the container. + Container to resolve from. + Name of the object to retrieve. + Any overrides for the resolve call. + The retrieved object. + + + + Resolve an instance of the default requested type from the container. + + Container to resolve from. + of object to get from the container. + Any overrides for the resolve call. + The retrieved object. + + + + Return instances of all registered types requested. + + + + This method is useful if you've registered multiple types with the same + but different names. + + + Be aware that this method does NOT return an instance for the default (unnamed) registration. + + + The type requested. + Container to resolve from. + Any overrides for the resolve calls. + Set of objects of type . + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + + This overload uses the default registrations. + + + of object to perform injection on. + Container to resolve through. + Instance to build up. + Any overrides for the buildup. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + of object to perform injection on. + Conatiner to resolve through. + Instance to build up. + name to use when looking up the typemappings and other configurations. + Any overrides for the Buildup. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + + This overload uses the default registrations. + + + Container to resolve through. + of object to perform injection on. + Instance to build up. + Any overrides for the Buildup. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Creates a new extension object and adds it to the container. + + Type of to add. The extension type + will be resolved from within the supplied . + Container to add the extension to. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Resolve access to a configuration interface exposed by an extension. + + Extensions can expose configuration interfaces as well as adding + strategies and policies to the container. This method walks the list of + added extensions and returns the first one that implements the requested type. + + The configuration interface required. + Container to configure. + The requested extension's configuration interface, or null if not found. + + + + Check if a particular type has been registered with the container with + the default name. + + Container to inspect. + Type to check registration for. + True if this type has been registered, false if not. + + + + Check if a particular type/name pair has been registered with the container. + + Container to inspect. + Type to check registration for. + Name to check registration for. + True if this type/name pair has been registered, false if not. + + + + Check if a particular type has been registered with the container with the default name. + + Type to check registration for. + Container to inspect. + True if this type has been registered, false if not. + + + + Check if a particular type/name pair has been registered with the container. + + Type to check registration for. + Container to inspect. + Name to check registration for. + True if this type/name pair has been registered, false if not. + + + + This extension supplies the default behavior of the UnityContainer API + by handling the context events and setting policies. + + + + + Install the default container behavior into the container. + + + + + Remove the default behavior from the container. + + + + + This extension installs the default strategies and policies into the container + to implement the standard behavior of the Unity container. + + + + + Add the default ObjectBuilder strategies & policies to the container. + + + + + A static helper class that includes various parameter checking routines. + + + + + Throws if the given argument is null. + + if tested value if null. + Argument value to test. + Name of the argument being tested. + + + + Throws an exception if the tested string argument is null or the empty string. + + Thrown if string value is null. + Thrown if the string is empty + Argument value to check. + Name of argument being checked. + + + + Verifies that an argument type is assignable from the provided type (meaning + interfaces are implemented, or classes exist in the base class hierarchy). + + The argument type that will be assigned to. + The type of the value being assigned. + Argument name. + + + + Verifies that an argument instance is assignable from the provided type (meaning + interfaces are implemented, or classes exist in the base class hierarchy, or instance can be + assigned through a runtime wrapper, as is the case for COM Objects). + + The argument type that will be assigned to. + The instance that will be assigned. + Argument name. + + + + Helper class to wrap common reflection stuff dealing with + methods. + + + + + Create a new instance that + lets us do more reflection stuff on that method. + + The method to reflect on. + + + + Given our set of generic type arguments, + + The generic type arguments. + An array with closed parameter types. + + + + Returns true if any of the parameters of this method + are open generics. + + + + + Return the of each parameter for this + method. + + Sequence of objects, one for + each parameter in order. + + + + A helper class that encapsulates two different + data items together into a a single item. + + + + + Create a new containing + the two values give. + + First value + Second value + + + + The first value of the pair. + + + + + The second value of the pair. + + + + + Container for a Pair helper method. + + + + + A helper factory method that lets users take advantage of type inference. + + Type of first value. + Type of second value. + First value. + Second value. + A new instance. + + + + A utility class that handles the logic of matching parameter + lists, so we can find the right constructor and method overloads. + + + + + Create a new that will attempt to + match the given parameter types. + + Target parameters to match against. + + + + Tests to see if the given set of types matches the ones + we're looking for. + + parameter list to look for. + true if they match, false if they don't. + + + + Tests to see if the given set of types matches the ones we're looking for. + + Candidate method signature to look for. + True if they match, false if they don't. + + + + Another reflection helper class that has extra methods + for dealing with ParameterInfos. + + + + + A small helper class to encapsulate details of the + reflection API, particularly around generics. + + + + + Create a new instance that + lets you look at information about the given type. + + Type to do reflection on. + + + + Test the given object, looking at + the parameters. Determine if any of the parameters are + open generic types that need type attributes filled in. + + The method to check. + True if any of the parameters are open generics. False if not. + + + + If this type is an open generic, use the + given array to + determine what the required closed type is and return that. + + If the parameter is not an open type, just + return this parameter's type. + Type arguments to substitute in for + the open type parameters. + Corresponding closed type of this parameter. + + + + Given a generic argument name, return the corresponding type for this + closed type. For example, if the current type is SomeType<User>, and the + corresponding definition was SomeType<TSomething>, calling this method + and passing "TSomething" will return typeof(User). + + Name of the generic parameter. + Type of the corresponding generic parameter, or null if there + is no matching name. + + + + The object we're reflecting over. + + + + + Is this type generic? + + + + + Is this type an open generic (no type parameter specified) + + + + + Is this type an array type? + + + + + Is this type an array of generic elements? + + + + + The type of the elements in this type (if it's an array). + + + + + Returns all the public constructors defined for the current reflected . + + + An enumeration of ConstructorInfo objects representing all the public instance constructors defined for the + current reflected , but not including the type initializer (static constructor). + + + + + Create a new instance of that + lets you query information about the given ParameterInfo object. + + Parameter to query. + + + + A set of helper methods to pick through lambdas and pull out + from them. + + + + + Pull out a object from an expression of the form + () => SomeClass.SomeMethod() + + Expression describing the method to call. + Corresponding . + + + + Pull out a object from an expression of the form + x => x.SomeMethod() + + The type where the method is defined. + Expression describing the method to call. + Corresponding . + + + + Pull out a object for the get method from an expression of the form + x => x.SomeProperty + + The type where the method is defined. + The type for the property. + Expression describing the property for which the get method is to be extracted. + Corresponding . + + + + Pull out a object for the set method from an expression of the form + x => x.SomeProperty + + The type where the method is defined. + The type for the property. + Expression describing the property for which the set method is to be extracted. + Corresponding . + + + + + + + + + + + + + Pull out a object from an expression of the form () => new SomeType() + + The type where the constructor is defined. + Expression invoking the desired constructor. + Corresponding . + + + diff -r 000000000000 -r 5bca2d201ad8 src/packages/Unity.3.0.1304.1/lib/wp8/Microsoft.Practices.Unity.WindowsPhone.dll Binary file src/packages/Unity.3.0.1304.1/lib/wp8/Microsoft.Practices.Unity.WindowsPhone.dll has changed diff -r 000000000000 -r 5bca2d201ad8 src/packages/Unity.3.0.1304.1/lib/wp8/Microsoft.Practices.Unity.WindowsPhone.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/packages/Unity.3.0.1304.1/lib/wp8/Microsoft.Practices.Unity.WindowsPhone.xml Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,6060 @@ + + + + Microsoft.Practices.Unity.WindowsPhone + + + + + A that emits IL to call constructors + as part of creating a build plan. + + + + + Represents a strategy in the chain of responsibility. + Strategies are required to support both BuildUp and TearDown. + + + + + Represents a strategy in the chain of responsibility. + Strategies are required to support both BuildUp and TearDown. Although you + can implement this interface directly, you may also choose to use + as the base class for your strategies, as + this class provides useful helper methods and makes support BuildUp and TearDown + optional. + + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + Called during the chain of responsibility for a build operation. The + PostBuildUp method is called when the chain has finished the PreBuildUp + phase and executes in reverse order from the PreBuildUp calls. + + Context of the build operation. + + + + Called during the chain of responsibility for a teardown operation. The + PreTearDown method is called when the chain is being executed in the + forward direction. + + Context of the teardown operation. + + + + Called during the chain of responsibility for a teardown operation. The + PostTearDown method is called when the chain has finished the PreTearDown + phase and executes in reverse order from the PreTearDown calls. + + Context of the teardown operation. + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + Called during the chain of responsibility for a build operation. The + PostBuildUp method is called when the chain has finished the PreBuildUp + phase and executes in reverse order from the PreBuildUp calls. + + Context of the build operation. + + + + Called during the chain of responsibility for a teardown operation. The + PreTearDown method is called when the chain is being executed in the + forward direction. + + Context of the teardown operation. + + + + Called during the chain of responsibility for a teardown operation. The + PostTearDown method is called when the chain has finished the PreTearDown + phase and executes in reverse order from the PreTearDown calls. + + Context of the teardown operation. + + + + Called during the chain of responsibility for a build operation. + + Existing object is an instance of . + The context for the operation. + + + + A helper method used by the generated IL to set up a PerResolveLifetimeManager lifetime manager + if the current object is such. + + Current build context. + + + + Build up the string that will represent the constructor signature + in any exception message. + + + + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A helper method used by the generated IL to throw an exception if + no existing object is present, but the user is attempting to build + an interface (usually due to the lack of a type mapping). + + The currently being + used for the build of this object. + + + + A helper method used by the generated IL to throw an exception if + a dependency cannot be resolved. + + The currently being + used for the build of this object. + + + + A helper method used by the generated IL to throw an exception if + a dependency cannot be resolved because of an invalid constructor. + + The currently being + used for the build of this object. + The signature of the invalid constructor. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Helper method used by generated IL to look up a dependency resolver based on the given key. + + Current build context. + Type of the dependency being resolved. + Key the resolver was stored under. + The found dependency resolver. + + + + The type that is to be built with the dynamic build plan. + + + + + The context parameter represeting the used when the build plan is executed. + + + + + + + + + + + + + + + + A build plan is an object that, when invoked, will create a new object + or fill in a given existing one. It encapsulates all the information + gathered by the strategies to construct a particular object. + + + + + Represents a builder policy interface. Since there are no fixed requirements + for policies, it acts as a marker interface from which to derive all other + policy interfaces. + + + + + Creates an instance of this build plan's type, or fills + in the existing type if passed in. + + Context used to build up the object. + + + + + + + + + + + + + + + + An implementation + that constructs a build plan via dynamic IL emission. + + + + + A that can create and return an + for the given build key. + + + + + Create a build plan using the given context and build key. + + Current build context. + Current build key. + The build plan. + + + + Construct a that + uses the given strategy chain to construct the build plan. + + The strategy chain. + + + + Construct a build plan. + + The current build context. + The current build key. + The created build plan. + + + + A that generates IL to call + chosen methods (as specified by the current ) + as part of object build up. + + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A that generates IL to resolve properties + on an object being built. + + + + + Called during the chain of responsibility for a build operation. + + The context for the operation. + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + A helper method used by the generated IL to store the current operation in the build context. + + + + + An implementation + that constructs a build plan for creating objects. + + + + + Creates a build plan using the given context and build key. + + Current build context. + Current build key. + + The build plan. + + + + + Provides helper methods to retrieve classes from assemblies. + + + + + Returns all visible, non-abstract classes from . + + The assemblies. + All visible, non-abstract classes found in the assemblies. + is . + contains elements. + All exceptions thrown while getting types from the assemblies are ignored, and the types that can be retrieved are returned. + + + + Returns all visible, non-abstract classes from , and optionally skips errors. + + to skip errors; otherwise, . + The assemblies. + + All visible, non-abstract classes. + + is . + contains elements. + + If is , all exceptions thrown while getting types from the assemblies are ignored, and the types + that can be retrieved are returned; otherwise, the original exception is thrown. + + + + + Returns all visible, non-abstract classes from . + + to skip errors; otherwise, . + The assemblies. + + All visible, non-abstract classes. + + is . + contains elements. + + If is , all exceptions thrown while getting types from the assemblies are ignored, and the types + that can be retrieved are returned; otherwise, the original exception is thrown. + + + + + Returns all visible, non-abstract classes from all assemblies located where the application is installed. + + to include the Unity assemblies; otherwise, . Defaults to . + to skip errors; otherwise, . + + All visible, non-abstract classes. + + + If is , all exceptions thrown while loading assemblies or getting types from the assemblies + are ignored, and the types that can be retrieved are returned; otherwise, the original exception is thrown. These exceptions might be wrapped in a + . + + + + + The exception that is thrown when registering multiple types would result in an type mapping being overwritten. + + + + + Initializes a new instance of the class. + + The name for the mapping. + The source type for the mapping. + The type currently mapped. + The new type to map. + + + + Gets the name for the mapping. + + + + + Gets the source type for the mapping. + + + + + Gets the type currently mapped. + + + + + Gets the new type to map. + + + + + Represents a set of types to register and their registration settings. + + + + + Gets types to register. + + + + + Gets a function to get the types that will be requested for each type to configure. + + + + + Gets a function to get the name to use for the registration of each type. + + + + + Gets a function to get the for the registration of each type. Defaults to no lifetime management. + + + + + + Gets a function to get the additional objects for the registration of each type. Defaults to no injection members. + + + + + + Provides a set of convenience overloads to the + interface to support registration of multiple types. + + + + + Registers the supplied types by using the specified rules for name, lifetime manager, injection members, and registration types. + + The container to configure. + The types to register. The methods in the class can be used to scan assemblies to get types, and further filtering can be performed using LINQ queries. + A function that gets the types that will be requested for each type to configure. It can be a method from the class or a custom function. Defaults to no registration types, and registers only the supplied types. + A function that gets the name to use for the registration of each type. It can be a method from the or a custom function. Defaults to no name. + A function that gets the for the registration of each type. It can be a method from the class or a custom function. Defaults to no lifetime management. + A function that gets the additional objects for the registration of each type. Defaults to no injection members. + to overwrite existing mappings; otherwise, . Defaults to . + + The container that this method was called on. + + A new registration would overwrite an existing mapping and is . + + + + Registers the types according to the . + + The container to configure. + The convention to determine which types will be registered and how. + to overwrite existing mappings; otherwise, . Defaults to . + + The container that this method was called on. + + + + + Provides helper methods to specify the lifetime for a type with registration by convention. + + + + + Returns a . + + The type. + A lifetime manager + + + + Returns a . + + The type. + A container controlled lifetime manager. + + + + Returns a . + + The type. + An externally controlled lifetime manager. + + + + Returns a . + + The type. + A hierarchical lifetime manager. + + + + Returns a . + + The type. + A per resolve lifetime manager. + + + + Returns a . + + The type. + A transient lifetime manager. + + + + Returns a . + + The custom type. + The type. + + A lifetime manager. + + + + + Provides helper methods to map types to the types interfaces to which register them. + + + + + Returns no types. + + The type to register. + An empty enumeration. + + + + Returns an enumeration with the interface that matches the name of . + + The type to register. + An enumeration with the first interface matching the name of (for example, if type is MyType, a matching interface is IMyType), + or an empty enumeration if no such interface is found. + + + + Returns an enumeration with all the interfaces implemented by . + + The type to register. + An enumeration with all the interfaces implemented by the implementation type except . + + + + Returns an enumeration with all the interfaces implemented by that belong to the same assembly as implementationType. + + The type to register. + An enumeration with all the interfaces implemented by the implementation type that belong to the same assembly. + + + + Provides helper methods to get type names. + + + + + Returns the type name. + + The type. + The type name. + + + + Returns null for the registration name. + + The type. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The type {0} has multiple constructors of length {1}. Unable to disambiguate.. + + + + + Looks up a localized string similar to The provided string argument must not be empty.. + + + + + Looks up a localized string similar to The current build operation (build key {2}) failed: {3} (Strategy type {0}, index {1}). + + + + + Looks up a localized string similar to The current type, {0}, is an interface and cannot be constructed. Are you missing a type mapping?. + + + + + Looks up a localized string similar to Cannot extract type from build key {0}.. + + + + + Looks up a localized string similar to The method {0}.{1}({2}) is an open generic method. Open generic methods cannot be injected.. + + + + + Looks up a localized string similar to The property {0} on type {1} is an indexer. Indexed properties cannot be injected.. + + + + + Looks up a localized string similar to The method {1} on type {0} has an out parameter. Injection cannot be performed.. + + + + + Looks up a localized string similar to The method {0}.{1}({2}) has at least one out parameter. Methods with out parameters cannot be injected.. + + + + + Looks up a localized string similar to The method {0}.{1}({2}) has at least one ref parameter.Methods with ref parameters cannot be injected.. + + + + + Looks up a localized string similar to The method {1} on type {0} is marked for injection, but it is an open generic method. Injection cannot be performed.. + + + + + Looks up a localized string similar to The method {0}.{1}({2}) is static. Static methods cannot be injected.. + + + + + Looks up a localized string similar to The type {0} is an open generic type. An open generic type cannot be resolved.. + + + + + Looks up a localized string similar to Resolving parameter "{0}" of constructor {1}. + + + + + Looks up a localized string similar to The parameter {0} could not be resolved when attempting to call constructor {1}.. + + + + + Looks up a localized string similar to An attempt to override an existing mapping was detected for type {1} with name "{0}", currently mapped to type {2}, to type {3}.. + + + + + Looks up a localized string similar to The set of assemblies contains a null element.. + + + + + Looks up a localized string similar to Parameter type inference does not work for null values. Indicate the parameter type explicitly using a properly configured instance of the InjectionParameter or InjectionParameter<T> classes.. + + + + + Looks up a localized string similar to Calling constructor {0}. + + + + + Looks up a localized string similar to Calling method {0}.{1}. + + + + + Looks up a localized string similar to An item with the given key is already present in the dictionary.. + + + + + Looks up a localized string similar to The lifetime manager is already registered. Lifetime managers cannot be reused, please create a new one.. + + + + + Looks up a localized string similar to The override marker build plan policy has been invoked. This should never happen, looks like a bug in the container.. + + + + + Looks up a localized string similar to Resolving parameter "{0}" of method {1}.{2}. + + + + + Looks up a localized string similar to The value for parameter "{1}" of method {0} could not be resolved. . + + + + + Looks up a localized string similar to Could not resolve dependency for build key {0}.. + + + + + Looks up a localized string similar to The type {0} has multiple constructors marked with the InjectionConstructor attribute. Unable to disambiguate.. + + + + + Looks up a localized string similar to The supplied type {0} must be an open generic type.. + + + + + Looks up a localized string similar to The supplied type {0} does not have the same number of generic arguments as the target type {1}.. + + + + + Looks up a localized string similar to The type {0} does not have an accessible constructor.. + + + + + Looks up a localized string similar to The type {0} does not have a generic argument named "{1}". + + + + + Looks up a localized string similar to while resolving. + + + + + Looks up a localized string similar to The type {0} does not have a constructor that takes the parameters ({1}).. + + + + + Looks up a localized string similar to The type {0} does not have a public method named {1} that takes the parameters ({2}).. + + + + + Looks up a localized string similar to The type {0} does not contain an instance property named {1}.. + + + + + Looks up a localized string similar to The type {0} is not a generic type, and you are attempting to inject a generic parameter named "{1}".. + + + + + Looks up a localized string similar to The type {0} is not an array type with rank 1, and you are attempting to use a [DependencyArray] attribute on a parameter or property with this type.. + + + + + Looks up a localized string similar to Optional dependencies must be reference types. The type {0} is a value type.. + + + + + Looks up a localized string similar to The property {0} on type {1} is not settable.. + + + + + Looks up a localized string similar to The property {0} on type {1} is of type {2}, and cannot be injected with a value of type {3}.. + + + + + Looks up a localized string similar to The value for the property "{0}" could not be resolved.. + + + + + Looks up a localized string similar to The provided string argument must not be empty.. + + + + + Looks up a localized string similar to Resolution of the dependency failed, type = "{0}", name = "{1}". + Exception occurred while: {2}. + Exception is: {3} - {4} + ----------------------------------------------- + At the time of the exception, the container was: + . + + + + + Looks up a localized string similar to Resolving {0},{1}. + + + + + Looks up a localized string similar to Resolving {0},{1} (mapped from {2}, {3}). + + + + + Looks up a localized string similar to Resolving value for property {0}.{1}. + + + + + Looks up a localized string similar to The constructor {1} selected for type {0} has ref or out parameters. Such parameters are not supported for constructor injection.. + + + + + Looks up a localized string similar to Setting value for property {0}.{1}. + + + + + Looks up a localized string similar to The type {0} cannot be constructed. You must configure the container to supply this value.. + + + + + Looks up a localized string similar to The type {1} cannot be assigned to variables of type {0}.. + + + + + Looks up a localized string similar to <unknown>. + + + + + Provides extension methods to the class due to the introduction + of class in the .NET for Windows Store apps. + + + + + Returns the constructor in that matches the specified constructor parameter types. + + The type to inspect + The constructor parameter types. + The constructor that matches the specified parameter types. + + + + Returns the non-static declared methods of a type or its base types. + + The type to inspect + An enumerable of the objects. + + + + Returns the non-static method of a type or its based type. + + The type to inspect + The name of the method to seek. + The (closed) parameter type signature of the method. + The discovered + + + + Returns the declared properties of a type or its base types. + + The type to inspect + An enumerable of the objects. + + + + Determines if the types in a parameter set ordinally matches the set of supplied types. + + + + + + + + This attribute is used to mark properties and parameters as targets for injection. + + + For properties, this attribute is necessary for injection to happen. For parameters, + it's not needed unless you want to specify additional information to control how + the parameter is resolved. + + + + + Base class for attributes that can be placed on parameters + or properties to specify how to resolve the value for + that parameter or property. + + + + + Create an instance of that + will be used to get the value for the member this attribute is + applied to. + + Type of parameter or property that + this attribute is decoration. + The resolver object. + + + + Create an instance of with no name. + + + + + Create an instance of with the given name. + + Name to use when resolving this dependency. + + + + Create an instance of that + will be used to get the value for the member this attribute is + applied to. + + Type of parameter or property that + this attribute is decoration. + The resolver object. + + + + The name specified in the constructor. + + + + + This attribute is used to indicate which constructor to choose when + the container attempts to build a type. + + + + + This attribute is used to mark methods that should be called when + the container is building an object. + + + + + An used to mark a dependency + as optional - the container will try to resolve it, and return null + if the resolution fails rather than throw. + + + + + Construct a new object. + + + + + Construct a new object that + specifies a named dependency. + + Name of the dependency. + + + + Create an instance of that + will be used to get the value for the member this attribute is + applied to. + + Type of parameter or property that + this attribute is decoration. + The resolver object. + + + + Name of the dependency. + + + + + A that composites other + ResolverOverride objects. The GetResolver operation then + returns the resolver from the first child override that + matches the current context and request. + + + + + Base class for all override objects passed in the + method. + + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + Wrap this resolver in one that verifies the type of the object being built. + This allows you to narrow any override down to a specific type easily. + + Type to constrain the override to. + The new override. + + + + Wrap this resolver in one that verifies the type of the object being built. + This allows you to narrow any override down to a specific type easily. + + Type to constrain the override to. + The new override. + + + + Add a new to the collection + that is checked. + + item to add. + + + + Add a setof s to the collection. + + items to add. + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + 2 + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + 1 + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + Class that returns information about the types registered in a container. + + + + + The type that was passed to the method + as the "from" type, or the only type if type mapping wasn't done. + + + + + The type that this registration is mapped to. If no type mapping was done, the + property and this one will have the same value. + + + + + Name the type was registered under. Null for default registration. + + + + + The registered lifetime manager instance. + + + + + The lifetime manager for this registration. + + + This property will be null if this registration is for an open generic. + + + + A class that overrides + the value injected whenever there is a dependency of the + given type, regardless of where it appears in the object graph. + + + + + Create an instance of to override + the given type with the given value. + + Type of the dependency. + Value to use. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + A convenience version of that lets you + specify the dependency type using generic syntax. + + Type of the dependency to override. + + + + Construct a new object that will + override the given dependency, and pass the given value. + + + + + A convenience form of that lets you + specify multiple parameter overrides in one shot rather than having + to construct multiple objects. + + + This class isn't really a collection, it just implements IEnumerable + so that we get use of the nice C# collection initializer syntax. + + + + + Base helper class for creating collections of objects + for use in passing a bunch of them to the resolve call. This base class provides + the mechanics needed to allow you to use the C# collection initializer syntax. + + Concrete type of the this class collects. + Key used to create the underlying override object. + Value that the override returns. + + + + Add a new override to the collection with the given key and value. + + Key - for example, a parameter or property name. + Value - the value to be returned by the override. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + 2 + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + 1 + + + + When implemented in derived classes, this method is called from the + method to create the actual objects. + + Key value to create the resolver. + Value to store in the resolver. + The created . + + + + When implemented in derived classes, this method is called from the + method to create the actual objects. + + Key value to create the resolver. + Value to store in the resolver. + The created . + + + + Event argument class for the event. + + + + + Construct a new object with the + given child container object. + + An for the newly created child + container. + + + + The newly created child container. + + + + + An extension context for the created child container. + + + + + The class provides the means for extension objects + to manipulate the internal state of the . + + + + + Store a type/name pair for later resolution. + + + + When users register type mappings (or other things) with a named key, this method + allows you to register that name with the container so that when the + method is called, that name is included in the list that is returned. + + to register. + Name assocated with that type. + + + + The container that this context is associated with. + + The object. + + + + The strategies this container uses. + + The that the container uses to build objects. + + + + The strategies this container uses to construct build plans. + + The that this container uses when creating + build plans. + + + + The policies this container uses. + + The the that container uses to build objects. + + + + The that this container uses. + + The is used to manage objects that the container is managing. + + + + This event is raised when the method, + or one of its overloads, is called. + + + + + This event is raised when the method, + or one of its overloads, is called. + + + + + This event is raised when the method is called, providing + the newly created child container to extensions to act on as they see fit. + + + + + Base interface for all extension configuration interfaces. + + + + + Retrieve the container instance that we are currently configuring. + + + + + An EventArgs class that holds a string Name. + + + + + Create a new with a null name. + + + + + Create a new with the given name. + + Name to store. + + + + The name. + + Name used for this event arg object. + + + + Event argument class for the event. + + + + + Create a new instance of . + + Type to map from. + Type to map to. + Name for the registration. + to manage instances. + + + + Type to map from. + + + + + Type to map to. + + + + + to manage instances. + + + + + Event argument class for the event. + + + + + Create a default instance. + + + + + Create a instance initialized with the given arguments. + + Type of instance being registered. + The instance object itself. + Name to register under, null if default registration. + object that handles how + the instance will be owned. + + + + Type of instance being registered. + + + Type of instance being registered. + + + + + Instance object being registered. + + Instance object being registered + + + + that controls ownership of + this instance. + + + + + Base class for all extension objects. + + + + + The container calls this method when the extension is added. + + A instance that gives the + extension access to the internals of the container. + + + + Initial the container with this extension's functionality. + + + When overridden in a derived class, this method will modify the given + by adding strategies, policies, etc. to + install it's functions into the container. + + + + Removes the extension's functions from the container. + + + + This method is called when extensions are being removed from the container. It can be + used to do things like disconnect event handlers or clean up member state. You do not + need to remove strategies or policies here; the container will do that automatically. + + + The default implementation of this method does nothing. + + + + + The container this extension has been added to. + + The that this extension has been added to. + + + + The object used to manipulate + the inner state of the container. + + + + + A that lets you specify that + an instance of a generic type parameter should be resolved. + + + + + Base class for subclasses that let you specify that + an instance of a generic type parameter should be resolved. + + + + + Base type for objects that are used to configure parameters for + constructor or method injection, or for getting the value to + be injected into a property. + + + + + Test to see if this parameter value has a matching type for the given type. + + Type to check. + True if this parameter value is compatible with type , + false if not. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + Convert the given set of arbitrary values to a sequence of InjectionParameterValue + objects. The rules are: If it's already an InjectionParameterValue, return it. If + it's a Type, return a ResolvedParameter object for that type. Otherwise return + an InjectionParameter object for that value. + + The values to build the sequence from. + The resulting converted sequence. + + + + Convert an arbitrary value to an InjectionParameterValue object. The rules are: + If it's already an InjectionParameterValue, return it. If it's a Type, return a + ResolvedParameter object for that type. Otherwise return an InjectionParameter + object for that value. + + The value to convert. + The resulting . + + + + Name for the type represented by this . + This may be an actual type name or a generic argument name. + + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + name to use when looking up in the container. + + + + Test to see if this parameter value has a matching type for the given type. + + Type to check. + True if this parameter value is compatible with type , + false if not. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + Return a instance that will + return this types value for the parameter. + + The actual type to resolve. + The resolution key. + The . + + + + Name for the type represented by this . + This may be an actual type name or a generic argument name. + + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + name to use when looking up in the container. + + + + Return a instance that will + return this types value for the parameter. + + The actual type to resolve. + The resolution key. + The . + + + + A that lets you specify that + an array containing the registered instances of a generic type parameter + should be resolved. + + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + The values for the elements, that will + be converted to objects. + + + + Test to see if this parameter value has a matching type for the given type. + + Type to check. + True if this parameter value is compatible with type , + false if not. + A type is considered compatible if it is an array type of rank one + and its element type is a generic type parameter with a name matching this generic + parameter name configured for the receiver. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + Name for the type represented by this . + This may be an actual type name or a generic argument name. + + + + + A Unity container extension that allows you to configure + which constructors, properties, and methods get injected + via an API rather than through attributes. + + + + + Initial the container with this extension's functionality. + + + When overridden in a derived class, this method will modify the given + by adding strategies, policies, etc. to + install it's functions into the container. + + + + API to configure the injection settings for a particular type. + + Type the injection is being configured for. + Objects containing the details on which members to inject and how. + This extension object. + + + + API to configure the injection settings for a particular type/name pair. + + Type the injection is being configured for. + Name of registration + Objects containing the details on which members to inject and how. + This extension object. + + + + API to configure the injection settings for a particular type. + + Type to configure. + Objects containing the details on which members to inject and how. + This extension object. + + + + API to configure the injection settings for a particular type/name pair. + + Type to configure. + Name of registration. + Objects containing the details on which members to inject and how. + This extension object. + + + + API to configure the injection settings for a particular type/name pair. + + Type of interface/base class being registered (may be null). + Type of actual implementation class being registered. + Name of registration. + Objects containing the details on which members to inject and how. + This extension object. + + + + A class that holds the collection of information + for a constructor, so that the container can + be configured to call this constructor. + + + + + Base class for objects that can be used to configure what + class members get injected by the container. + + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Type to register. + Policy list to add policies to. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Type of interface being registered. If no interface, + this will be null. + Type of concrete type being registered. + Name used to resolve the type object. + Policy list to add policies to. + + + + Create a new instance of that looks + for a constructor with the given set of parameters. + + The values for the parameters, that will + be converted to objects. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Interface registered, ignored in this implementation. + Type to register. + Name used to resolve the type object. + Policy list to add policies to. + + + + A class that lets you specify a factory method the container + will use to create the object. + + This is a significantly easier way to do the same + thing the old static factory extension was used for. + + + + Create a new instance of with + the given factory function. + + Factory function. + + + + Create a new instance of with + the given factory function. + + Factory function. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Type of interface being registered. If no interface, + this will be null. This parameter is ignored in this implementation. + Type of concrete type being registered. + Name used to resolve the type object. + Policy list to add policies to. + + + + An that configures the + container to call a method as part of buildup. + + + + + Create a new instance which will configure + the container to call the given methods with the given parameters. + + Name of the method to call. + Parameter values for the method. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Type of interface registered, ignored in this implementation. + Type to register. + Name used to resolve the type object. + Policy list to add policies to. + + + + A small function to handle name matching. You can override this + to do things like case insensitive comparisons. + + MethodInfo for the method you're checking. + Name of the method you're looking for. + True if a match, false if not. + + + + A class that holds on to the given value and provides + the required + when the container is configured. + + + + + A base class for implementing classes + that deal in explicit types. + + + + + Create a new that exposes + information about the given . + + Type of the parameter. + + + + Test to see if this parameter value has a matching type for the given type. + + Type to check. + True if this parameter value is compatible with type , + false if not. + + + + The type of parameter this object represents. + + + + + Name for the type represented by this . + This may be an actual type name or a generic argument name. + + + + + Create an instance of that stores + the given value, using the runtime type of that value as the + type of the parameter. + + Value to be injected for this parameter. + + + + Create an instance of that stores + the given value, associated with the given type. + + Type of the parameter. + Value of the parameter + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + A generic version of that makes it a + little easier to specify the type of the parameter. + + Type of parameter. + + + + Create a new . + + Value for the parameter. + + + + This class stores information about which properties to inject, + and will configure the container accordingly. + + + + + Configure the container to inject the given property name, + resolving the value via the container. + + Name of the property to inject. + + + + Configure the container to inject the given property name, + using the value supplied. This value is converted to an + object using the + rules defined by the + method. + + Name of property to inject. + Value for property. + + + + Add policies to the to configure the + container to call this constructor with the appropriate parameter values. + + Interface being registered, ignored in this implemenation. + Type to register. + Name used to resolve the type object. + Policy list to add policies to. + + + + A that lets you specify that + an instance of a generic type parameter should be resolved, providing the + value if resolving fails. + + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + + + + Create a new instance that specifies + that the given named generic parameter should be resolved. + + The generic parameter name to resolve. + name to use when looking up in the container. + + + + Return a instance that will + return this types value for the parameter. + + The actual type to resolve. + The resolution key. + The . + + + + A that can be passed to + to configure a + parameter or property as an optional dependency. + + + + + Construct a new object that + specifies the given . + + Type of the dependency. + + + + Construct a new object that + specifies the given and . + + Type of the dependency. + Name for the dependency. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + A generic version of that lets you + specify the type of the dependency using generics syntax. + + Type of the dependency. + + + + Construct a new . + + + + + Construct a new with the given + . + + Name of the dependency. + + + + A class that stores a type, and generates a + resolver object that resolves all the named instances or the + type registered in a container. + + + + + Construct a new that + resolves to the given element type and collection of element values. + + The type of elements to resolve. + The values for the elements, that will + be converted to objects. + + + + Construct a new that + resolves to the given array and element types and collection of element values. + + The type for the array of elements to resolve. + The type of elements to resolve. + The values for the elements, that will + be converted to objects. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + A generic version of for convenience + when creating them by hand. + + Type of the elements for the array of the parameter. + + + + Construct a new that + resolves to the given element generic type with the given element values. + + The values for the elements, that will + be converted to objects. + + + + A class that stores a name and type, and generates a + resolver object that resolves the parameter via the + container. + + + + + Construct a new that + resolves to the given type. + + Type of this parameter. + + + + Construct a new that + resolves the given type and name. + + Type of this parameter. + Name to use when resolving parameter. + + + + Return a instance that will + return this types value for the parameter. + + Type that contains the member that needs this parameter. Used + to resolve open generic parameters. + The . + + + + A generic version of for convenience + when creating them by hand. + + Type of the parameter + + + + Create a new for the given + generic type and the default name. + + + + + Create a new for the given + generic type and name. + + Name to use to resolve this parameter. + + + + Interface defining the behavior of the Unity dependency injection container. + + + + + Register a type mapping with the container, where the created instances will use + the given . + + that will be requested. + that will actually be returned. + Name to use for registration, null if a default registration. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Name for registration. + + object that controls how this instance will be managed by the container. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Resolve an instance of the requested type with the given name from the container. + + of object to get from the container. + Name of the object to retrieve. + Any overrides for the resolve call. + The retrieved object. + + + + Return instances of all registered types requested. + + + + This method is useful if you've registered multiple types with the same + but different names. + + + Be aware that this method does NOT return an instance for the default (unnamed) registration. + + + The type requested. + Any overrides for the resolve calls. + Set of objects of type . + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + of object to perform injection on. + Instance to build up. + name to use when looking up the typemappings and other configurations. + Any overrides for the resolve calls. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Run an existing object through the container, and clean it up. + + The object to tear down. + + + + Add an extension object to the container. + + to add. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Resolve access to a configuration interface exposed by an extension. + + Extensions can expose configuration interfaces as well as adding + strategies and policies to the container. This method walks the list of + added extensions and returns the first one that implements the requested type. + + of configuration interface required. + The requested extension's configuration interface, or null if not found. + + + + Remove all installed extensions from this container. + + + + This method removes all extensions from the container, including the default ones + that implement the out-of-the-box behavior. After this method, if you want to use + the container again you will need to either readd the default extensions or replace + them with your own. + + + The registered instances and singletons that have already been set up in this container + do not get removed. + + + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Create a child container. + + + A child container shares the parent's configuration, but can be configured with different + settings or lifetime. + The new child container. + + + + The parent of this container. + + The parent container, or null if this container doesn't have one. + + + + Get a sequence of that describe the current state + of the container. + + + + + A that holds onto the instance given to it. + When the is disposed, + the instance is disposed with it. + + + + + Base class for Lifetime managers which need to synchronize calls to + . + + + + The purpose of this class is to provide a basic implementation of the lifetime manager synchronization pattern. + + + Calls to the method of a + instance acquire a lock, and if the instance has not been initialized with a value yet the lock will only be released + when such an initialization takes place by calling the method or if + the build request which resulted in the call to the GetValue method fails. + + + + + + + Base class for Lifetime managers - classes that control how + and when instances are created by the Unity container. + + + + + A that controls how instances are + persisted and recovered from an external store. Used to implement + things like singletons and per-http-request lifetime. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object to store. + + + + Remove the value this lifetime policy is managing from backing store. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + + + + Remove the given object from backing store. + + + + + This interface provides a hook for the builder context to + implement error recovery when a builder strategy throws + an exception. Since we can't get try/finally blocks onto + the call stack for later stages in the chain, we instead + add these objects to the context. If there's an exception, + all the current IRequiresRecovery instances will have + their Recover methods called. + + + + + A method that does whatever is needed to clean up + as part of cleaning up after an exception. + + + Don't do anything that could throw in this method, + it will cause later recover operations to get skipped + and play real havoc with the stack trace. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + Calls to this method acquire a lock which is released only if a non-null value + has been set for the lifetime manager. + + + + Performs the actual retrieval of a value from the backing store associated + with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + This method is invoked by + after it has acquired its lock. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + Setting a value will attempt to release the lock acquired by + . + + + + Performs the actual storage of the given value into backing store for retrieval later. + + The object being stored. + This method is invoked by + before releasing its lock. + + + + Remove the given object from backing store. + + + + + A method that does whatever is needed to clean up + as part of cleaning up after an exception. + + + Don't do anything that could throw in this method, + it will cause later recover operations to get skipped + and play real havoc with the stack trace. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + + + + Remove the given object from backing store. + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + 2 + + + + Standard Dispose pattern implementation. Not needed, but it keeps FxCop happy. + + Always true, since we don't have a finalizer. + + + + A that holds a weak reference to + it's managed instance. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + + + + Remove the given object from backing store. + + + + + A special lifetime manager which works like , + except that in the presence of child containers, each child gets it's own instance + of the object, instead of sharing one in the common parent. + + + + + An implementation of that + creates instances of the type of the given Lifetime Manager + by resolving them through the container. + + + + + A builder policy used to create lifetime policy instances. + Used by the LifetimeStrategy when instantiating open + generic types. + + + + + Create a new instance of . + + The new instance. + + + + The type of Lifetime manager that will be created by this factory. + + + + + Create a new that will + return instances of the given type, creating them by + resolving through the container. + + Container to resolve with. + Type of LifetimeManager to create. + + + + Create a new instance of . + + The new instance. + + + + The type of Lifetime manager that will be created by this factory. + + + + + This is a custom lifetime manager that acts like , + but also provides a signal to the default build plan, marking the type so that + instances are reused across the build up object graph. + + + + + Construct a new object that does not + itself manage an instance. + + + + + Construct a new object that stores the + give value. This value will be returned by + but is not stored in the lifetime manager, nor is the value disposed. + This Lifetime manager is intended only for internal use, which is why the + normal method is not used here. + + Value to store. + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. In this class, + this is a noop, since it has special hooks down in the guts. + + The object being stored. + + + + Remove the given object from backing store. Noop in this class. + + + + + An implementation that does nothing, + thus ensuring that instances are created new every time. + + + + + Retrieve a value from the backing store associated with this Lifetime policy. + + the object desired, or null if no such object is currently stored. + + + + Stores the given value into backing store for retrieval later. + + The object being stored. + + + + Remove the given object from backing store. + + + + + This strategy implements the logic that will call container.ResolveAll + when an array parameter is detected. + + + + + Do the PreBuildUp stage of construction. This is where the actual work is performed. + + Current build context. + + + + An implementation of that is + aware of the build keys used by the Unity container. + + + + + Base class that provides an implementation of + which lets you override how the parameter resolvers are created. + + + + + A that, when implemented, + will determine which constructor to call from the build plan. + + + + + Choose the constructor to call for the given type. + + Current build context + The to add any + generated resolver objects into. + The chosen constructor. + + + + Choose the constructor to call for the given type. + + Current build context + The to add any + generated resolver objects into. + The chosen constructor. + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. + + + + Value Condition Less than zerox is less than y.Zerox equals y.Greater than zerox is greater than y. + + + The second object to compare. + The first object to compare. + + + + Create a instance for the given + . + + + This implementation looks for the Unity on the + parameter and uses it to create an instance of + for this parameter. + Parameter to create the resolver for. + The resolver object. + + + + An implementation of that is aware + of the build keys used by the Unity container. + + + + + Base class that provides an implementation of + which lets you override how the parameter resolvers are created. + + Attribute that marks methods that should + be called. + + + + An that will examine the given + types and return a sequence of objects + that should be called as part of building the object. + + + + + Return the sequence of methods to call while building the target object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of methods to call. + + + + Return the sequence of methods to call while building the target object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of methods to call. + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + An implementation of that is aware of + the build keys used by the unity container. + + + + + Base class that provides an implementation of + which lets you override how the parameter resolvers are created. + + + + + An that returns a sequence + of properties that should be injected for the given type. + + + + + Returns sequence of properties on the given type that + should be set as part of building that object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of objects + that contain the properties to set. + + + + Returns sequence of properties on the given type that + should be set as part of building that object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of objects + that contain the properties to set. + + + + Create a for the given + property. + + Property to create resolver for. + The resolver object. + + + + Create a for the given + property. + + Property to create resolver for. + The resolver object. + + + + A strategy that handles Hierarchical lifetimes across a set of parent/child + containers. + + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + A implementation that returns + the value set in the constructor. + + + + + A that is used at build plan execution time + to resolve a dependent value. + + + + + Get the value for a dependency. + + Current build context. + The value for the dependency. + + + + Create a new instance of + which will return the given value when resolved. + + The value to return. + + + + Get the value for a dependency. + + Current build context. + The value for the dependency. + + + + An implementation of that stores a + type and name, and at resolution time puts them together into a + . + + + + + Create an instance of + with the given type and name. + + The type. + The name (may be null). + + + + Resolve the value for a dependency. + + Current build context. + The value for the dependency. + + + + The type that this resolver resolves. + + + + + The name that this resolver resolves. + + + + + A that will attempt to + resolve a value, and return null if it cannot rather than throwing. + + + + + Construct a new object + that will attempt to resolve the given name and type from the container. + + Type to resolve. Must be a reference type. + Name to resolve with. + + + + Construct a new object + that will attempt to resolve the given type from the container. + + Type to resolve. Must be a reference type. + + + + Get the value for a dependency. + + Current build context. + The value for the dependency. + + + + Type this resolver will resolve. + + + + + Name this resolver will resolve. + + + + + An implementation of that resolves to + to an array populated with the values that result from resolving other instances + of . + + + + + Create an instance of + with the given type and a collection of + instances to use when populating the result. + + The type. + The resolver policies to use when populating an array. + + + + Resolve the value for a dependency. + + Current build context. + An array pupulated with the results of resolving the resolver policies. + + + + An implementation of that selects + the given constructor and creates the appropriate resolvers to call it with + the specified parameters. + + + + + Create an instance of that + will return the given constructor, being passed the given injection values + as parameters. + + The constructor to call. + Set of objects + that describes how to obtain the values for the constructor parameters. + + + + Choose the constructor to call for the given type. + + Current build context + The to add any + generated resolver objects into. + The chosen constructor. + + + + Helper class for implementing selector policies that need to + set up dependency resolver policies. + + + + + Add dependency resolvers to the parameter set. + + Type that's currently being built (used to resolve open generics). + PolicyList to add the resolvers to. + Objects supplying the dependency resolvers. + Result object to store the keys in. + + + + A implementation that calls the specific + methods with the given parameters. + + + + + Add the given method and parameter collection to the list of methods + that will be returned when the selector's + method is called. + + Method to call. + sequence of objects + that describe how to create the method parameter values. + + + + Return the sequence of methods to call while building the target object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of methods to call. + + + + An implemnetation of which returns + the set of specific properties that the selector was configured with. + + + + + Add a property that will be par of the set returned when the + is called. + + The property to set. + object describing + how to create the value to inject. + + + + Returns sequence of properties on the given type that + should be set as part of building that object. + + Current build context. + The to add any + generated resolver objects into. + Sequence of objects + that contain the properties to set. + + + + The build stages we use in the Unity container + strategy pipeline. + + + + + First stage. By default, nothing happens here. + + + + + Second stage. Type mapping occurs here. + + + + + Third stage. lifetime managers are checked here, + and if they're available the rest of the pipeline is skipped. + + + + + Fourth stage. Reflection over constructors, properties, etc. is + performed here. + + + + + Fifth stage. Instance creation happens here. + + + + + Sixth stage. Property sets and method injection happens here. + + + + + Seventh and final stage. By default, nothing happens here. + + + + + Represents the context in which a build-up or tear-down operation runs. + + + + + Represents the context in which a build-up or tear-down operation runs. + + + + + Add a new set of resolver override objects to the current build operation. + + objects to add. + + + + Get a object for the given + or null if that dependency hasn't been overridden. + + Type of the dependency. + Resolver to use, or null if no override matches for the current operation. + + + + A convenience method to do a new buildup operation on an existing context. + + Key to use to build up. + Created object. + + + + A convenience method to do a new buildup operation on an existing context. This + overload allows you to specify extra policies which will be in effect for the duration + of the build. + + Key defining what to build up. + A delegate that takes a . This + is invoked with the new child context before the build up process starts. This gives callers + the opportunity to customize the context for the build process. + Created object. + + + + Gets the head of the strategy chain. + + + The strategy that's first in the chain; returns null if there are no + strategies in the chain. + + + + + Gets the associated with the build. + + + The associated with the build. + + + + + Gets the original build key for the build operation. + + + The original build key for the build operation. + + + + + Get the current build key for the current build operation. + + + + + The set of policies that were passed into this context. + + This returns the policies passed into the context. + Policies added here will remain after buildup completes. + The persistent policies for the current context. + + + + Gets the policies for the current context. + + Any policies added to this object are transient + and will be erased at the end of the buildup. + + The policies for the current context. + + + + + Gets the collection of objects + that need to execute in event of an exception. + + + + + The current object being built up or torn down. + + + The current object being manipulated by the build operation. May + be null if the object hasn't been created yet. + + + + Flag indicating if the build operation should continue. + + true means that building should not call any more + strategies, false means continue to the next strategy. + + + + An object representing what is currently being done in the + build chain. Used to report back errors if there's a failure. + + + + + The build context used to resolve a dependency during the build operation represented by this context. + + + + + Initialize a new instance of the class. + + + + + Initialize a new instance of the class with a , + , and the + build key used to start this build operation. + + The to use for this context. + The to use for this context. + The to use for this context. + Build key to start building. + The existing object to build up. + + + + Create a new using the explicitly provided + values. + + The to use for this context. + The to use for this context. + The set of persistent policies to use for this context. + The set of transient policies to use for this context. It is + the caller's responsibility to ensure that the transient and persistent policies are properly + combined. + Build key for this context. + Existing object to build up. + + + + Add a new set of resolver override objects to the current build operation. + + objects to add. + + + + Get a object for the given + or null if that dependency hasn't been overridden. + + Type of the dependency. + Resolver to use, or null if no override matches for the current operation. + + + + A convenience method to do a new buildup operation on an existing context. + + Key to use to build up. + Created object. + + + + A convenience method to do a new buildup operation on an existing context. This + overload allows you to specify extra policies which will be in effect for the duration + of the build. + + Key defining what to build up. + A delegate that takes a . This + is invoked with the new child context before the build up process starts. This gives callers + the opportunity to customize the context for the build process. + Created object. + + + + Gets the head of the strategy chain. + + + The strategy that's first in the chain; returns null if there are no + strategies in the chain. + + + + + Get the current build key for the current build operation. + + + + + The current object being built up or torn down. + + + The current object being manipulated by the build operation. May + be null if the object hasn't been created yet. + + + + Gets the associated with the build. + + + The associated with the build. + + + + + Gets the original build key for the build operation. + + + The original build key for the build operation. + + + + + The set of policies that were passed into this context. + + This returns the policies passed into the context. + Policies added here will remain after buildup completes. + The persistent policies for the current context. + + + + Gets the policies for the current context. + + + Any modifications will be transient (meaning, they will be forgotten when + the outer BuildUp for this context is finished executing). + + + The policies for the current context. + + + + + Gets the collection of objects + that need to execute in event of an exception. + + + + + Flag indicating if the build operation should continue. + + true means that building should not call any more + strategies, false means continue to the next strategy. + + + + An object representing what is currently being done in the + build chain. Used to report back errors if there's a failure. + + + + + The build context used to resolve a dependency during the build operation represented by this context. + + + + + Represents that a dependency could not be resolved. + + + + + Initializes a new instance of the class with no extra information. + + + + + Initializes a new instance of the class with the given message. + + Some random message. + + + + Initialize a new instance of the class with the given + message and inner exception. + + Some random message + Inner exception. + + + + Initializes a new instance of the class with the build key of the object begin built. + + The build key of the object begin built. + + + + The exception thrown when injection is attempted on a method + that is an open generic or has out or ref params. + + + + + Construct a new with no + message. + + + + + Construct a with the given message + + Message to return. + + + + Construct a with the given message + and inner exception. + + Message to return. + Inner exception + + + + Extension methods to provide convenience overloads over the + interface. + + + + + Start a recursive build up operation to retrieve the default + value for the given type. + + Type of object to build. + Parent context. + Resulting object. + + + + Start a recursive build up operation to retrieve the named + implementation for the given type. + + Type to resolve. + Parent context. + Name to resolve with. + The resulting object. + + + + Add a set of s to the context, specified as a + variable argument list. + + Context to add overrides to. + The overrides. + + + + Data structure that stores the set of + objects and executes them when requested. + + + + + Add a new object to this + list. + + Object to add. + + + + Execute the method + of everything in the recovery list. Recoveries will execute + in the opposite order of add - it's a stack. + + + + + Return the number of recovery objects currently in the stack. + + + + + Represents a lifetime container. + + + A lifetime container tracks the lifetime of an object, and implements + IDisposable. When the container is disposed, any objects in the + container which implement IDisposable are also disposed. + + + + + Adds an object to the lifetime container. + + The item to be added to the lifetime container. + + + + Determine if a given object is in the lifetime container. + + + The item to locate in the lifetime container. + + + Returns true if the object is contained in the lifetime + container; returns false otherwise. + + + + + Removes an item from the lifetime container. The item is + not disposed. + + The item to be removed. + + + + Gets the number of references in the lifetime container + + + The number of references in the lifetime container + + + + + Represents a lifetime container. + + + A lifetime container tracks the lifetime of an object, and implements + IDisposable. When the container is disposed, any objects in the + container which implement IDisposable are also disposed. + + + + + Adds an object to the lifetime container. + + The item to be added to the lifetime container. + + + + Determine if a given object is in the lifetime container. + + + The item to locate in the lifetime container. + + + Returns true if the object is contained in the lifetime + container; returns false otherwise. + + + + + Releases the resources used by the . + + + + + Releases the managed resources used by the DbDataReader and optionally releases the unmanaged resources. + + + true to release managed and unmanaged resources; false to release only unmanaged resources. + + + + + Returns an enumerator that iterates through the lifetime container. + + + An object that can be used to iterate through the life time container. + + + + + Returns an enumerator that iterates through the lifetime container. + + + An object that can be used to iterate through the life time container. + + + + + Removes an item from the lifetime container. The item is + not disposed. + + The item to be removed. + + + + Gets the number of references in the lifetime container + + + The number of references in the lifetime container + + + + + A custom collection over objects. + + + + + Removes an individual policy type for a build key. + + The type of policy to remove. + The key the policy applies. + + + + Removes all policies from the list. + + + + + Removes a default policy. + + The type the policy was registered as. + + + + Gets an individual policy. + + The interface the policy is registered under. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy list in the chain that the searched for policy was found in, null if the policy was + not found. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + The interface the policy is registered under. + The key the policy applies to. + True if the search should be in the local policy list only; otherwise false to search up the parent chain. + The policy list in the chain that the searched for policy was found in, null if the policy was + not found. + The policy in the list if present; returns null otherwise. + + + + Sets an individual policy. + + The of the policy. + The policy to be registered. + The key the policy applies. + + + + Sets a default policy. When checking for a policy, if no specific individual policy + is available, the default will be used. + + The interface to register the policy under. + The default policy to be registered. + + + + A custom collection wrapper over objects. + + + + + Initialize a new instance of a class. + + + + + Initialize a new instance of a class with another policy list. + + An inner policy list to search. + + + + Removes an individual policy type for a build key. + + The type of policy to remove. + The key the policy applies. + + + + Removes all policies from the list. + + + + + Removes a default policy. + + The type the policy was registered as. + + + + Gets an individual policy. + + The interface the policy is registered under. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy list in the chain that the searched for policy was found in, null if the policy was + not found. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + The interface the policy is registered under. + The key the policy applies to. + True if the search should be in the local policy list only; otherwise false to search up the parent chain. + The policy list in the chain that the searched for policy was found in, null if the policy was + not found. + The policy in the list if present; returns null otherwise. + + + + Sets an individual policy. + + The of the policy. + The policy to be registered. + The key the policy applies. + + + + Sets a default policy. When checking for a policy, if no specific individual policy + is available, the default will be used. + + The interface to register the policy under. + The default policy to be registered. + + + + Gets the number of items in the locator. + + + The number of items in the locator. + + + + + Extension methods on to provide convenience + overloads (generic versions, mostly). + + + + + Removes an individual policy type for a build key. + + The type the policy was registered as. + to remove the policy from. + The key the policy applies. + + + + Removes a default policy. + + The type the policy was registered as. + to remove the policy from. + + + + Gets an individual policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + The policy list that actually contains the returned policy. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + to search. + The interface the policy is registered under. + The key the policy applies. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + to search. + The interface the policy is registered under. + The key the policy applies. + The policy list that actually contains the returned policy. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy list that actually contains the returned policy. + The policy in the list, if present; returns null otherwise. + + + + Gets an individual policy. + + to search. + The interface the policy is registered under. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + The interface the policy is registered under. + to search. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy list that actually contains the returned policy. + The policy in the list, if present; returns null otherwise. + + + + Get the non default policy. + + to search. + The interface the policy is registered under. + The key the policy applies. + true if the policy searches local only; otherwise false to seach up the parent chain. + The policy in the list, if present; returns null otherwise. + + + + Sets an individual policy. + + The interface the policy is registered under. + to add the policy to. + The policy to be registered. + The key the policy applies. + + + + Sets a default policy. When checking for a policy, if no specific individual policy + is available, the default will be used. + + The interface to register the policy under. + to add the policy to. + The default policy to be registered. + + + + An implementation of . + + + + + Add a new object to this + list. + + Object to add. + + + + Execute the method + of everything in the recovery list. Recoveries will execute + in the opposite order of add - it's a stack. + + + + + Return the number of recovery objects currently in the stack. + + + + + Implementation of which will notify an object about + the completion of a BuildUp operation, or start of a TearDown operation. + + + This strategy checks the object that is passing through the builder chain to see if it + implements IBuilderAware and if it does, it will call + and . This strategy is meant to be used from the + stage. + + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + Called during the chain of responsibility for a teardown operation. The + PreTearDown method is called when the chain is being executed in the + forward direction. + + Context of the teardown operation. + + + + Implemented on a class when it wants to receive notifications + about the build process. + + + + + Called by the when the object is being built up. + + The key of the object that was just built up. + + + + Called by the when the object is being torn down. + + + + + Enumeration to represent the object builder stages. + + + The order of the values in the enumeration is the order in which the stages are run. + + + + + Strategies in this stage run before creation. Typical work done in this stage might + include strategies that use reflection to set policies into the context that other + strategies would later use. + + + + + Strategies in this stage create objects. Typically you will only have a single policy-driven + creation strategy in this stage. + + + + + Strategies in this stage work on created objects. Typical work done in this stage might + include setter injection and method calls. + + + + + Strategies in this stage work on objects that are already initialized. Typical work done in + this stage might include looking to see if the object implements some notification interface + to discover when its initialization stage has been completed. + + + + + Represents a builder policy for mapping build keys. + + + + + Represents a builder policy for mapping build keys. + + + + + Maps the build key. + + The build key to map. + Current build context. Used for contextual information + if writing a more sophisticated mapping. This parameter can be null + (called when getting container registrations). + The new build key. + + + + Initialize a new instance of the with the new build key. + + The new build key. + + + + Maps the build key. + + The build key to map. + Current build context. Used for contextual information + if writing a more sophisticated mapping, unused in this implementation. + The new build key. + + + + Represents a strategy for mapping build keys in the build up operation. + + + + + Called during the chain of responsibility for a build operation. Looks for the + and if found maps the build key for the current operation. + + The context for the operation. + + + + An implementation of that can map + generic types. + + + + + Create a new instance + that will map generic types. + + Build key to map to. This must be or contain an open generic type. + + + + Maps the build key. + + The build key to map. + Current build context. Used for contextual information + if writing a more sophisticated mapping. + The new build key. + + + + Base class for the current operation stored in the build context. + + + + + Create a new . + + Type currently being built. + + + + The type that's currently being built. + + + + + A that will look for a build plan + in the current context. If it exists, it invokes it, otherwise + it creates one and stores it for later, and invokes it. + + + + + Called during the chain of responsibility for a build operation. + + The context for the operation. + + + + An implementation of that chooses + constructors based on these criteria: first, pick a constructor marked with the + attribute. If there + isn't one, then choose the constructor with the longest parameter list. If that is ambiguous, + then throw. + + Thrown when the constructor to choose is ambiguous. + Attribute used to mark the constructor to call. + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + Objects of this type are the return value from . + It encapsulates the desired with the string keys + needed to look up the for each + parameter. + + + + + Base class for return values from selector policies that + return a memberinfo of some sort plus a list of parameter + keys to look up the parameter resolvers. + + + + + Base class for return of selector policies that need + to keep track of a set of parameter keys. + + + + + Add a new parameter key to this object. Keys are assumed + to be in the order of the parameters to the constructor. + + Key for the next parameter to look up. + + + + The set of keys for the constructor parameters. + + + + + Construct a new , storing + the given member info. + + Member info to store. + + + + The member info stored. + + + + + Create a new instance which + contains the given constructor. + + The constructor to wrap. + + + + The constructor this object wraps. + + + + + This class records the information about which constructor argument is currently + being resolved, and is responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + The type that is being constructed. + A string representing the constructor being called. + Parameter being resolved. + + + + Generate the string describing what parameter was being resolved. + + The description string. + + + + String describing the constructor being set up. + + + + + Parameter that's being resolved. + + + + + A class that records that a constructor is about to be call, and is + responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + + + + Generate the description string. + + The string. + + + + Constructor we're trying to call. + + + + + A class that records that a constructor is about to be call, and is + responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + + + + Generate the description string. + + The string. + + + + Method we're trying to call. + + + + + This class records the information about which constructor argument is currently + being resolved, and is responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + The type that is being constructed. + A string representing the method being called. + Parameter being resolved. + + + + Generate the string describing what parameter was being resolved. + + The description string. + + + + String describing the method being set up. + + + + + Parameter that's being resolved. + + + + + A base class that holds the information shared by all operations + performed by the container while setting properties. + + + + + Initializes a new instance of the class. + + + + + Generate the description of this operation. + + The string. + + + + Get a format string used to create the description. Called by + the base method. + + The format string. + + + + The property value currently being resolved. + + + + + This class records the information about which property value is currently + being resolved, and is responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + + + + Get a format string used to create the description. Called by + the base method. + + The format string. + + + + This class records the information about which property value is currently + being set, and is responsible for generating the error string required when + an error has occurred. + + + + + Initializes a new instance of the class. + + Type property is on. + Name of property being set. + + + + Get a format string used to create the description. Called by + the base method. + + The format string. + + + + Build plan for that will + return a func that will resolve the requested type + through this container later. + + + + + Creates an instance of this build plan's type, or fills + in the existing type if passed in. + + Context used to build up the object. + + + + An implementation of that selects + methods by looking for the given + attribute on those methods. + + Type of attribute used to mark methods + to inject. + + + + Create a instance for the given + . + + Parameter to create the resolver for. + The resolver object. + + + + Objects of this type are the return value from . + It encapsulates the desired with the string keys + needed to look up the for each + parameter. + + + + + Create a new instance which + contains the given method. + + The method + + + + The constructor this object wraps. + + + + + Creates an instance of this build plan's type, or fills + in the existing type if passed in. + + Context used to build up the object. + + + + An implementation of that looks + for properties marked with the + attribute that are also settable and not indexers. + + + + + + Create a for the given + property. + + Property to create resolver for. + The resolver object. + + + + Objects of this type are returned from + . + This class combines the about + the property with the string key used to look up the resolver + for this property's value. + + + + + Create an instance of + with the given and key. + + The property. + Key to use to look up the resolver. + + + + PropertyInfo for this property. + + + + + Key to look up this property's resolver. + + + + + Implementation of . + + + + + A builder policy that lets you keep track of the current + resolvers and will remove them from the given policy set. + + + + + Add a new resolver to track by key. + + Key that was used to add the resolver to the policy set. + + + + Remove the currently tracked resolvers from the given policy list. + + Policy list to remove the resolvers from. + + + + Add a new resolver to track by key. + + Key that was used to add the resolver to the policy set. + + + + Remove the currently tracked resolvers from the given policy list. + + Policy list to remove the resolvers from. + + + + Get an instance that implements , + either the current one in the policy set or creating a new one if it doesn't + exist. + + Policy list to look up from. + Build key to track. + The resolver tracker. + + + + Add a key to be tracked to the current tracker. + + Policy list containing the resolvers and trackers. + Build key for the resolvers being tracked. + Key for the resolver. + + + + Remove the resolvers for the given build key. + + Policy list containing the build key. + Build key. + + + + An implementation of that + calls back into the build chain to build up the dependency, passing + a type given at compile time as its build key. + + + + + Create a new instance storing the given type. + + Type to resolve. + + + + Get the value for a dependency. + + Current build context. + The value for the dependency. + + + + This interface defines a standard method to convert any + regardless + of the stage enum into a regular, flat strategy chain. + + + + + Convert this into + a flat . + + The flattened . + + + + Represents a chain of responsibility for builder strategies. + + + + + Reverse the order of the strategy chain. + + The reversed strategy chain. + + + + Execute this strategy chain against the given context, + calling the Buildup methods on the strategies. + + Context for the build process. + The build up object + + + + Execute this strategy chain against the given context, + calling the TearDown methods on the strategies. + + Context for the teardown process. + + + + An implementation that uses + a to figure out if an object + has already been created and to update or remove that + object from some backing store. + + + + + Called during the chain of responsibility for a build operation. The + PreBuildUp method is called when the chain is being executed in the + forward direction. + + Context of the build operation. + + + + Called during the chain of responsibility for a build operation. The + PostBuildUp method is called when the chain has finished the PreBuildUp + phase and executes in reverse order from the PreBuildUp calls. + + Context of the build operation. + + + + Represents a chain of responsibility for builder strategies partitioned by stages. + + The stage enumeration to partition the strategies. + + + + Initialize a new instance of the class. + + + + + Initialize a new instance of the class with an inner strategy chain to use when building. + + The inner strategy chain to use first when finding strategies in the build operation. + + + + Adds a strategy to the chain at a particular stage. + + The strategy to add to the chain. + The stage to add the strategy. + + + + Add a new strategy for the . + + The of + The stage to add the strategy. + + + + Clear the current strategy chain list. + + + This will not clear the inner strategy chain if this instane was created with one. + + + + + Makes a strategy chain based on this instance. + + A new . + + + + Represents a chain of responsibility for builder strategies. + + + + + Initialzie a new instance of the class. + + + + + Initialzie a new instance of the class with a colleciton of strategies. + + A collection of strategies to initialize the chain. + + + + Adds a strategy to the chain. + + The strategy to add to the chain. + + + + Adds strategies to the chain. + + The strategies to add to the chain. + + + + Reverse the order of the strategy chain. + + The reversed strategy chain. + + + + Execute this strategy chain against the given context to build up. + + Context for the build processes. + The build up object + + + + Execute this strategy chain against the given context, + calling the TearDown methods on the strategies. + + Context for the teardown process. + + + + Returns an enumerator that iterates through the collection. + + + + A that can be used to iterate through the collection. + + 1 + + + + Returns an enumerator that iterates through a collection. + + + + An object that can be used to iterate through the collection. + + 2 + + + + The almost inevitable collection of extra helper methods on + to augment the rich set of what + Linq already gives us. + + + + + Execute the provided on every item in . + + Type of the items stored in + Sequence of items to process. + Code to run over each item. + + + + Create a single string from a sequenc of items, separated by the provided , + and with the conversion to string done by the given . + + This method does basically the same thing as , + but will work on any sequence of items, not just arrays. + Type of items in the sequence. + Sequence of items to convert. + Separator to place between the items in the string. + The conversion function to change TItem -> string. + The resulting string. + + + + Create a single string from a sequenc of items, separated by the provided , + and with the conversion to string done by the item's method. + + This method does basically the same thing as , + but will work on any sequence of items, not just arrays. + Type of items in the sequence. + Sequence of items to convert. + Separator to place between the items in the string. + The resulting string. + + + + Build key used to combine a type object with a string name. Used by + ObjectBuilder to indicate exactly what is being built. + + + + + Create a new instance with the given + type and name. + + to build. + Key to use to look up type mappings and singletons. + + + + Create a new instance for the default + buildup of the given type. + + to build. + + + + This helper method creates a new instance. It is + initialized for the default key for the given type. + + Type to build. + A new instance. + + + + This helper method creates a new instance for + the given type and key. + + Type to build + Key to use to look up type mappings and singletons. + A new instance initialized with the given type and name. + + + + Compare two instances. + + Two instances compare equal + if they contain the same name and the same type. Also, comparing + against a different type will also return false. + Object to compare to. + True if the two keys are equal, false if not. + + + + Calculate a hash code for this instance. + + A hash code. + + + + Compare two instances for equality. + + Two instances compare equal + if they contain the same name and the same type. + First of the two keys to compare. + Second of the two keys to compare. + True if the values of the keys are the same, else false. + + + + Compare two instances for inequality. + + Two instances compare equal + if they contain the same name and the same type. If either field differs + the keys are not equal. + First of the two keys to compare. + Second of the two keys to compare. + false if the values of the keys are the same, else true. + + + + Formats the build key as a string (primarily for debugging). + + A readable string representation of the build key. + + + + Return the stored in this build key. + + The type to build. + + + + Returns the name stored in this build key. + + The name to use when building. + + + + A generic version of so that + you can new up a key using generic syntax. + + Type for the key. + + + + Construct a new that + specifies the given type. + + + + + Construct a new that + specifies the given type and name. + + Name for the key. + + + + A series of helper methods to deal with sequences - + objects that implement . + + + + + A function that turns an arbitrary parameter list into an + . + + Type of arguments. + The items to put into the collection. + An array that contains the values of the . + + + + Given two sequences, return a new sequence containing the corresponding values + from each one. + + Type of first sequence. + Type of second sequence. + First sequence of items. + Second sequence of items. + New sequence of pairs. This sequence ends when the shorter of sequence1 and sequence2 does. + + + + A class that lets you + override a named parameter passed to a constructor. + + + + + Construct a new object that will + override the given named constructor parameter, and pass the given + value. + + Name of the constructor parameter. + Value to pass for the constructor. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + A convenience form of that lets you + specify multiple parameter overrides in one shot rather than having + to construct multiple objects. + + + + + When implemented in derived classes, this method is called from the + method to create the actual objects. + + Key value to create the resolver. + Value to store in the resolver. + The created . + + + + A that lets you override + the value for a specified property. + + + + + Create an instance of . + + The property name. + Value to use for the property. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + A convenience form of that lets you + specify multiple property overrides in one shot rather than having + to construct multiple objects. + + + + + When implemented in derived classes, this method is called from the + method to create the actual objects. + + Key value to create the resolver. + Value to store in the resolver. + The created . + + + + The exception thrown by the Unity container when + an attempt to resolve a dependency fails. + + + + + Create a new that records + the exception for the given type and name. + + Type requested from the container. + Name requested from the container. + The actual exception that caused the failure of the build. + The build context representing the failed operation. + + + + The type that was being requested from the container at the time of failure. + + + + + The name that was being requested from the container at the time of failure. + + + + + Interface defining the configuration interface exposed by the + Static Factory extension. + + + + + Register the given factory delegate to be called when the container is + asked to resolve . + + Type that will be requested from the container. + Delegate to invoke to create the instance. + The container extension object this method was invoked on. + + + + Register the given factory delegate to be called when the container is + asked to resolve and . + + Type that will be requested from the container. + The name that will be used when requesting to resolve this type. + Delegate to invoke to create the instance. + The container extension object this method was invoked on. + + + + A that lets you register a + delegate with the container to create an object, rather than calling + the object's constructor. + + + + + Initialize this extension. This particular extension requires no + initialization work. + + + + + Register the given factory delegate to be called when the container is + asked to resolve and . + + Type that will be requested from the container. + The name that will be used when requesting to resolve this type. + Delegate to invoke to create the instance. + The container extension object this method was invoked on. + + + + Register the given factory delegate to be called when the container is + asked to resolve . + + Type that will be requested from the container. + Delegate to invoke to create the instance. + The container extension object this method was invoked on. + + + + An implementation of that + acts as a decorator over another . + This checks to see if the current type being built is the + right one before checking the inner . + + + + + Create an instance of + + Type to check for. + Inner override to check after type matches. + + + + Return a that can be used to give a value + for the given desired dependency. + + Current build context. + Type of dependency desired. + a object if this override applies, null if not. + + + + A convenience version of that lets you + specify the type to construct via generics syntax. + + Type to check for. + + + + Create an instance of . + + Inner override to check after type matches. + + + + A simple, extensible dependency injection container. + + + + + Create a default . + + + + + Create a with the given parent container. + + The parent . The current object + will apply its own settings first, and then check the parent for additional ones. + + + + RegisterType a type mapping with the container, where the created instances will use + the given . + + that will be requested. + that will actually be returned. + Name to use for registration, null if a default registration. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + RegisterType an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Name for registration. + + If true, the container will take over the lifetime of the instance, + calling Dispose on it (if it's ) when the container is Disposed. + + If false, container will not maintain a strong reference to . User is reponsible + for disposing instance, and for keeping the instance from being garbage collected. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Get an instance of the requested type with the given name from the container. + + of object to get from the container. + Name of the object to retrieve. + Any overrides for the resolve call. + The retrieved object. + + + + Return instances of all registered types requested. + + + + This method is useful if you've registered multiple types with the same + but different names. + + + Be aware that this method does NOT return an instance for the default (unnamed) registration. + + + The type requested. + Any overrides for the resolve calls. + Set of objects of type . + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + of object to perform injection on. + Instance to build up. + name to use when looking up the typemappings and other configurations. + Any overrides for the buildup. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Run an existing object through the container, and clean it up. + + The object to tear down. + + + + Add an extension object to the container. + + to add. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Get access to a configuration interface exposed by an extension. + + Extensions can expose configuration interfaces as well as adding + strategies and policies to the container. This method walks the list of + added extensions and returns the first one that implements the requested type. + + of configuration interface required. + The requested extension's configuration interface, or null if not found. + + + + Remove all installed extensions from this container. + + + + This method removes all extensions from the container, including the default ones + that implement the out-of-the-box behavior. After this method, if you want to use + the container again you will need to either readd the default extensions or replace + them with your own. + + + The registered instances and singletons that have already been set up in this container + do not get removed. + + + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Create a child container. + + + A child container shares the parent's configuration, but can be configured with different + settings or lifetime. + The new child container. + + + + Dispose this container instance. + + + Disposing the container also disposes any child containers, + and disposes any instances whose lifetimes are managed + by the container. + + + + + Dispose this container instance. + + + This class doesn't have a finalizer, so will always be true. + True if being called from the IDisposable.Dispose + method, false if being called from a finalizer. + + + + Remove policies associated with building this type. This removes the + compiled build plan so that it can be rebuilt with the new settings + the next time this type is resolved. + + Type of object to clear the plan for. + Name the object is being registered with. + + + + The parent of this container. + + The parent container, or null if this container doesn't have one. + + + + Get a sequence of that describe the current state + of the container. + + + + + Implementation of the ExtensionContext that is actually used + by the UnityContainer implementation. + + + This is a nested class so that it can access state in the + container that would otherwise be inaccessible. + + + + + This event is raised when the method, + or one of its overloads, is called. + + + + + Extension class that adds a set of convenience overloads to the + interface. + + + + + Register a type with specific members to be injected. + + Type this registration is for. + Container to configure. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container. + + + + This method is used to tell the container that when asked for type , + actually return an instance of type . This is very useful for + getting instances of interfaces. + + + This overload registers a default mapping and transient lifetime. + + + that will be requested. + that will actually be returned. + Container to configure. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container, where the created instances will use + the given . + + that will be requested. + that will actually be returned. + Container to configure. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container. + + + This method is used to tell the container that when asked for type , + actually return an instance of type . This is very useful for + getting instances of interfaces. + + that will be requested. + that will actually be returned. + Container to configure. + Name of this mapping. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container, where the created instances will use + the given . + + that will be requested. + that will actually be returned. + Container to configure. + Name to use for registration, null if a default registration. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type with the container. + No type mapping is performed for this type. + + The type to apply the to. + Container to configure. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type with the container. + No type mapping is performed for this type. + + The type to configure injection on. + Container to configure. + Name that will be used to request the type. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type and name with the container. + No type mapping is performed for this type. + + The type to apply the to. + Container to configure. + Name that will be used to request the type. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type with specific members to be injected. + + Container to configure. + Type this registration is for. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container. + + + + This method is used to tell the container that when asked for type , + actually return an instance of type . This is very useful for + getting instances of interfaces. + + + This overload registers a default mapping. + + + Container to configure. + that will be requested. + that will actually be returned. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container. + + + This method is used to tell the container that when asked for type , + actually return an instance of type . This is very useful for + getting instances of interfaces. + + Container to configure. + that will be requested. + that will actually be returned. + Name to use for registration, null if a default registration. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a type mapping with the container, where the created instances will use + the given . + + Container to configure. + that will be requested. + that will actually be returned. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type and name with the container. + No type mapping is performed for this type. + + Container to configure. + The to apply the to. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type and name with the container. + No type mapping is performed for this type. + + Container to configure. + The to configure in the container. + Name to use for registration, null if a default registration. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register a for the given type and name with the container. + No type mapping is performed for this type. + + Container to configure. + The to apply the to. + Name to use for registration, null if a default registration. + The that controls the lifetime + of the returned instance. + Injection configuration objects. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload does a default registration and has the container take over the lifetime of the instance. + + Type of instance to register (may be an implemented interface instead of the full type). + Container to configure. + Object to returned. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload does a default registration (name = null). + + + Type of instance to register (may be an implemented interface instead of the full type). + Container to configure. + Object to returned. + + object that controls how this instance will be managed by the container. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload automatically has the container take ownership of the . + + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Container to configure. + Name for registration. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Container to configure. + Name for registration. + + object that controls how this instance will be managed by the container. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload does a default registration and has the container take over the lifetime of the instance. + + Container to configure. + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload does a default registration (name = null). + + + Container to configure. + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + + object that controls how this instance will be managed by the container. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Register an instance with the container. + + + + Instance registration is much like setting a type as a singleton, except that instead + of the container creating the instance the first time it is requested, the user + creates the instance ahead of type and adds that instance to the container. + + + This overload automatically has the container take ownership of the . + + Container to configure. + Type of instance to register (may be an implemented interface instead of the full type). + Object to returned. + Name for registration. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Resolve an instance of the default requested type from the container. + + of object to get from the container. + Container to resolve from. + Any overrides for the resolve call. + The retrieved object. + + + + Resolve an instance of the requested type with the given name from the container. + + of object to get from the container. + Container to resolve from. + Name of the object to retrieve. + Any overrides for the resolve call. + The retrieved object. + + + + Resolve an instance of the default requested type from the container. + + Container to resolve from. + of object to get from the container. + Any overrides for the resolve call. + The retrieved object. + + + + Return instances of all registered types requested. + + + + This method is useful if you've registered multiple types with the same + but different names. + + + Be aware that this method does NOT return an instance for the default (unnamed) registration. + + + The type requested. + Container to resolve from. + Any overrides for the resolve calls. + Set of objects of type . + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + + This overload uses the default registrations. + + + of object to perform injection on. + Container to resolve through. + Instance to build up. + Any overrides for the buildup. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + of object to perform injection on. + Conatiner to resolve through. + Instance to build up. + name to use when looking up the typemappings and other configurations. + Any overrides for the Buildup. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Run an existing object through the container and perform injection on it. + + + + This method is useful when you don't control the construction of an + instance (ASP.NET pages or objects created via XAML, for instance) + but you still want properties and other injection performed. + + + This overload uses the default registrations. + + + Container to resolve through. + of object to perform injection on. + Instance to build up. + Any overrides for the Buildup. + The resulting object. By default, this will be , but + container extensions may add things like automatic proxy creation which would + cause this to return a different object (but still type compatible with ). + + + + Creates a new extension object and adds it to the container. + + Type of to add. The extension type + will be resolved from within the supplied . + Container to add the extension to. + The object that this method was called on (this in C#, Me in Visual Basic). + + + + Resolve access to a configuration interface exposed by an extension. + + Extensions can expose configuration interfaces as well as adding + strategies and policies to the container. This method walks the list of + added extensions and returns the first one that implements the requested type. + + The configuration interface required. + Container to configure. + The requested extension's configuration interface, or null if not found. + + + + Check if a particular type has been registered with the container with + the default name. + + Container to inspect. + Type to check registration for. + True if this type has been registered, false if not. + + + + Check if a particular type/name pair has been registered with the container. + + Container to inspect. + Type to check registration for. + Name to check registration for. + True if this type/name pair has been registered, false if not. + + + + Check if a particular type has been registered with the container with the default name. + + Type to check registration for. + Container to inspect. + True if this type has been registered, false if not. + + + + Check if a particular type/name pair has been registered with the container. + + Type to check registration for. + Container to inspect. + Name to check registration for. + True if this type/name pair has been registered, false if not. + + + + This extension supplies the default behavior of the UnityContainer API + by handling the context events and setting policies. + + + + + Install the default container behavior into the container. + + + + + Remove the default behavior from the container. + + + + + This extension installs the default strategies and policies into the container + to implement the standard behavior of the Unity container. + + + + + Add the default ObjectBuilder strategies & policies to the container. + + + + + A static helper class that includes various parameter checking routines. + + + + + Throws if the given argument is null. + + if tested value if null. + Argument value to test. + Name of the argument being tested. + + + + Throws an exception if the tested string argument is null or the empty string. + + Thrown if string value is null. + Thrown if the string is empty + Argument value to check. + Name of argument being checked. + + + + Verifies that an argument type is assignable from the provided type (meaning + interfaces are implemented, or classes exist in the base class hierarchy). + + The argument type that will be assigned to. + The type of the value being assigned. + Argument name. + + + + Verifies that an argument instance is assignable from the provided type (meaning + interfaces are implemented, or classes exist in the base class hierarchy, or instance can be + assigned through a runtime wrapper, as is the case for COM Objects). + + The argument type that will be assigned to. + The instance that will be assigned. + Argument name. + + + + Helper class to wrap common reflection stuff dealing with + methods. + + + + + Create a new instance that + lets us do more reflection stuff on that method. + + The method to reflect on. + + + + Given our set of generic type arguments, + + The generic type arguments. + An array with closed parameter types. + + + + Returns true if any of the parameters of this method + are open generics. + + + + + Return the of each parameter for this + method. + + Sequence of objects, one for + each parameter in order. + + + + A helper class that encapsulates two different + data items together into a a single item. + + + + + Create a new containing + the two values give. + + First value + Second value + + + + The first value of the pair. + + + + + The second value of the pair. + + + + + Container for a Pair helper method. + + + + + A helper factory method that lets users take advantage of type inference. + + Type of first value. + Type of second value. + First value. + Second value. + A new instance. + + + + A utility class that handles the logic of matching parameter + lists, so we can find the right constructor and method overloads. + + + + + Create a new that will attempt to + match the given parameter types. + + Target parameters to match against. + + + + Tests to see if the given set of types matches the ones + we're looking for. + + parameter list to look for. + true if they match, false if they don't. + + + + Tests to see if the given set of types matches the ones we're looking for. + + Candidate method signature to look for. + True if they match, false if they don't. + + + + Another reflection helper class that has extra methods + for dealing with ParameterInfos. + + + + + A small helper class to encapsulate details of the + reflection API, particularly around generics. + + + + + Create a new instance that + lets you look at information about the given type. + + Type to do reflection on. + + + + Test the given object, looking at + the parameters. Determine if any of the parameters are + open generic types that need type attributes filled in. + + The method to check. + True if any of the parameters are open generics. False if not. + + + + If this type is an open generic, use the + given array to + determine what the required closed type is and return that. + + If the parameter is not an open type, just + return this parameter's type. + Type arguments to substitute in for + the open type parameters. + Corresponding closed type of this parameter. + + + + Given a generic argument name, return the corresponding type for this + closed type. For example, if the current type is SomeType<User>, and the + corresponding definition was SomeType<TSomething>, calling this method + and passing "TSomething" will return typeof(User). + + Name of the generic parameter. + Type of the corresponding generic parameter, or null if there + is no matching name. + + + + The object we're reflecting over. + + + + + Is this type generic? + + + + + Is this type an open generic (no type parameter specified) + + + + + Is this type an array type? + + + + + Is this type an array of generic elements? + + + + + The type of the elements in this type (if it's an array). + + + + + Returns all the public constructors defined for the current reflected . + + + An enumeration of ConstructorInfo objects representing all the public instance constructors defined for the + current reflected , but not including the type initializer (static constructor). + + + + + Create a new instance of that + lets you query information about the given ParameterInfo object. + + Parameter to query. + + + + A set of helper methods to pick through lambdas and pull out + from them. + + + + + Pull out a object from an expression of the form + () => SomeClass.SomeMethod() + + Expression describing the method to call. + Corresponding . + + + + Pull out a object from an expression of the form + x => x.SomeMethod() + + The type where the method is defined. + Expression describing the method to call. + Corresponding . + + + + Pull out a object for the get method from an expression of the form + x => x.SomeProperty + + The type where the method is defined. + The type for the property. + Expression describing the property for which the get method is to be extracted. + Corresponding . + + + + Pull out a object for the set method from an expression of the form + x => x.SomeProperty + + The type where the method is defined. + The type for the property. + Expression describing the property for which the set method is to be extracted. + Corresponding . + + + + + + + + + + + + + Pull out a object from an expression of the form () => new SomeType() + + The type where the constructor is defined. + Expression invoking the desired constructor. + Corresponding . + + + diff -r 000000000000 -r 5bca2d201ad8 src/packages/Unity.3.0.1304.1/tools/install.ps1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/packages/Unity.3.0.1304.1/tools/install.ps1 Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,3 @@ +param($installPath, $toolsPath, $package, $project) + +$project.DTE.ItemOperations.Navigate('https://unity.codeplex.com/wikipage?title=Unity3ReleaseNotes') \ No newline at end of file diff -r 000000000000 -r 5bca2d201ad8 src/packages/repositories.config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/packages/repositories.config Sun Aug 24 11:14:55 2014 +0400 @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file