Summary
An
Wyam.Common.Execution.IExecutionContext
that can be used for testing.
- Assembly
- Wyam
.Testing .dll - Namespace
- Wyam
.Testing .Execution - Interfaces
-
- IExecutionContext
- IMetadata
- IReadOnlyDictionary
<string, Object> - ITypeConversions
- Base Types
-
- Object
graph BT
Type-->Base0["Object"]
Type-.->Interface0["IExecutionContext"]
click Interface0 "/api/Wyam.Common.Execution/IExecutionContext"
Type-.->Interface1["IMetadata"]
click Interface1 "/api/Wyam.Common.Meta/IMetadata"
Type-.->Interface2["IReadOnlyDictionary<string, Object>"]
Type-.->Interface3["ITypeConversions"]
click Interface3 "/api/Wyam.Testing.Meta/ITypeConversions"
Type["TestExecutionContext"]
class Type type-node
Syntax
public class TestExecutionContext : IExecutionContext, IMetadata,
IReadOnlyDictionary<string, Object>, ITypeConversions
Properties
Name | Value | Summary |
---|---|---|
ApplicationInput | string |
Gets any input that was passed to the application (for example, on stdin via piping).
|
Count | int | |
Documents | IDocumentCollection |
Gets the collection of all previously processed documents.
|
DynamicAssemblies | IReadOnlyCollection |
Gets the raw bytes for dynamically compiled assemblies (such as the configuration script).
|
ExecutionCache | IExecutionCache |
Gets the current execution cache. Modules can use the cache to store data between executions.
|
ExecutionId | Guid |
Uniquly identifies the current execution cycle. This can be used to initialize and/or
reset static data for a module on new generations (I.e., due to watching).
For example, cache data could be cleared when this changes between runs.
|
FileSystem | IReadOnlyFileSystem |
Gets the current file system.
|
HttpResponseFunc | Func |
A message handler that should be used to register
System.Net.Http.HttpResponseMessage
instances for a given request.
|
JsEngineFunc | Func |
|
Keys | IEnumerable |
|
Module | IModule |
Gets the currently executing module.
|
Namespaces | IReadOnlyCollection |
Gets a set of namespaces that should be brought into scope for modules that perform dynamic compilation.
|
Pipeline | IReadOnlyPipeline |
Gets the currently executing pipeline.
|
Settings | ISettings | |
Shortcodes | IShortcodeCollection | |
this[string] | Object | |
TypeConversions | Dictionary |
|
Values | IEnumerable |
Methods
Name | Value | Summary |
---|---|---|
AddTypeConversion |
void | |
ContainsKey |
bool | |
CreateHttpClient |
HttpClient |
Creates a
System.Net.Http.HttpClient instance that should be used for all HTTP communication.
|
CreateHttpClient |
HttpClient |
Creates a new
System.Net.Http.HttpClient instance that uses a custom message handler.
|
Execute |
IReadOnlyList |
Executes the specified modules with the specified input documents and returns the result documents.
|
Execute |
IReadOnlyList |
Executes the specified modules with an empty initial input document with optional additional metadata and returns the result documents.
|
Execute |
IReadOnlyList |
Executes the specified modules with an empty initial input document with optional additional metadata and returns the result documents.
|
Get |
Object |
Gets the value for the specified key. This method never throws an exception. It will return the specified
default value or null if the key is not found.
|
Get |
T |
Gets the value for the specified key converted to the specified type.
This method never throws an exception. It will return default(T) if the key is not found
or the value cannot be converted to T.
|
Get |
T |
Gets the value for the specified key. This method never throws an exception. It will return the specified
default value if the key is not found.
|
GetContentStream |
Stream |
Gets a
System.IO.Stream that can be used for document content. If content
is not null, the stream is initialized with the specified content. It is prefered to use
this method to obtain a stream over creating your own if the source of the content does
not already provide one. The returned streams are optimized for memory usage and performance.
|
GetDocument |
IDocument |
Gets a new document with default initial metadata.
|
GetDocument |
IDocument |
Gets a new document with the specified source and metadata (in addition to the default initial metadata).
|
GetDocument |
IDocument |
Gets a new document with the specified source, content stream, and metadata (in addition to the default initial metadata).
If disposeStream is true (which it is by default), the provided
System.IO.Stream will automatically be disposed when the document is disposed (I.e., the
document takes ownership of the System.IO.Stream ).
|
GetDocument |
IDocument | |
GetDocument |
IDocument |
Clones the specified source document with a new source and additional metadata (all existing metadata is retained)
or gets a new document if the source document is null or
AsNewDocuments() was called on the module.
|
GetDocument |
IDocument |
Clones the specified source document with a new source, new content stream, and additional metadata (all existing metadata is retained)
or gets a new document if the source document is null or
AsNewDocuments() was called on the module.
If disposeStream is true (which it is by default), the provided
System.IO.Stream will automatically be disposed when the document is disposed (I.e., the
document takes ownership of the System.IO.Stream ).
|
GetDocument |
IDocument | |
GetDocument |
IDocument |
Clones the specified source document with identical content and additional metadata (all existing metadata is retained)
or gets a new document if the source document is null or
AsNewDocuments() was called on the module.
|
GetDocument |
IDocument |
Clones the specified source document with a new content stream, and additional metadata (all existing metadata is retained)
or gets a new document if the source document is null or
AsNewDocuments() was called on the module.
If disposeStream is true (which it is by default), the provided
System.IO.Stream will automatically be disposed when the document is disposed (I.e., the
document takes ownership of the System.IO.Stream ).
|
GetDocument |
IDocument | |
GetDocument |
IDocument |
Gets a new document with the specified metadata (in addition to the default initial metadata).
|
GetDocument |
IDocument |
Gets a new document with the specified content stream and metadata (in addition to the default initial metadata).
If disposeStream is true (which it is by default), the provided
System.IO.Stream will automatically be disposed when the document is disposed (I.e., the
document takes ownership of the System.IO.Stream ).
|
GetDocument |
IDocument | |
GetEnumerator |
IEnumerator |
|
Get |
I |
Gets a new
Wyam.Common.JavaScript.IJavaScriptEnginePool . The returned engine pool should be disposed
when no longer needed.
|
GetMetadata |
IMetadata |
Gets a new
Wyam.Common.Meta.IMetadata containing only the specified keys and their values. If a key is not present in the current
metadata, it will be ignored and will not be copied to the new metadata object.
|
GetRaw |
Object |
Gets the raw value for the specified key. This method will not materialize
Wyam.Common.Meta.IMetadataValue
values the way Wyam.Common.Meta.IMetadata.Get(System.String,System.Object) will. A System.Collections.Generic.KeyNotFoundException will be thrown
for missing keys.
|
GetShortcodeResult |
IShortcodeResult |
A factory method for use from inside an
Wyam.Common.Shortcodes.IShortcode to create an Wyam.Common.Shortcodes.IShortcodeResult .
|
GetShortcodeResult |
IShortcodeResult |
A factory method for use from inside an
Wyam.Common.Shortcodes.IShortcode to create an Wyam.Common.Shortcodes.IShortcodeResult .
|
MetadataAs |
IMetadata |
Presents metadata values as a specific type (see
Wyam.Common.Meta.IMetadata ).
|
TryConvert |
bool |
Provides access to the same enhanced type conversion used to convert metadata types.
|
TryGetValue |
bool | |
TryGetValue |
bool |
Tries to get the value for the specified key.
|