TestDocument Class

Summary

A simple document that stores metadata in a Dictionary without any built-in type conversion. Also no support for content at this time.
Assembly
Wyam.Testing.dll
Namespace
Wyam.Testing.Documents
Interfaces
Base Types
  • Object
graph BT Type-->Base0["Object"] Type-.->Interface0["IDocument"] click Interface0 "/api/Wyam.Common.Documents/IDocument" Type-.->Interface1["IMetadata"] click Interface1 "/api/Wyam.Common.Meta/IMetadata" Type-.->Interface2["IReadOnlyDictionary<string, Object>"] Type-.->Interface3["IDisposable"] Type-.->Interface4["ITypeConversions"] click Interface4 "/api/Wyam.Testing.Meta/ITypeConversions" Type["TestDocument"] class Type type-node

Syntax

public class TestDocument : IDocument, IMetadata, IReadOnlyDictionary<string, Object>, IDisposable, 
    ITypeConversions

Constructors

Properties

Name Value Summary
Content string
Count int
Id string
Keys IEnumerable<string>
Metadata IMetadata
Source FilePath
Stream Stream
Lets you set the document stream directly
this[string] Object
TypeConversions Dictionary<(Type Value, Type Result), Func<Object, Object>>
Values IEnumerable<Object>
WithoutSettings IMetadata

Methods

Name Value Summary
AddTypeConversion<T, TResult>(Func<T, TResult>) void
ContainsKey(string) bool
Dispose() void
Get(string, Object) Object
Get<T>(string) T
Get<T>(string, T) T
GetEnumerator() IEnumerator<KeyValuePair<string, Object>>
GetMetadata(string[]) 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(string) Object
GetStream() Stream
MetadataAs<T>() IMetadata<T>
SourceString() string
TryGetValue(string, Object) bool
TryGetValue<T>(string, T) bool
GitHub