Class MessageMetadataCache
Caches message metadata for xUnit.net v3 messages. The metadata which is cached depends on the message that is passed (for example, looking up with an ITestAssemblyMessage will return an IAssemblyMetadata). Storage methods require the "Starting" versions of messages (as these are the ones which contain the metadata), and removal methods require the "Finished" versions of messages.
public class MessageMetadataCache
- Inheritance
-
MessageMetadataCache
- Inherited Members
Methods
Set(ITestAssemblyStarting)
Sets IAssemblyMetadata into the cache.
public void Set(ITestAssemblyStarting message)
Parameters
messageITestAssemblyStartingThe message that contains the metadata.
Set(ITestCaseStarting)
Sets ITestCaseMetadata into the cache.
public void Set(ITestCaseStarting message)
Parameters
messageITestCaseStartingThe message that contains the metadata.
Set(ITestClassStarting)
Sets ITestClassMetadata into the cache.
public void Set(ITestClassStarting message)
Parameters
messageITestClassStartingThe message that contains the metadata.
Set(ITestCollectionStarting)
Sets ITestCollectionMetadata into the cache.
public void Set(ITestCollectionStarting message)
Parameters
messageITestCollectionStartingThe message that contains the metadata.
Set(ITestMethodStarting)
Sets ITestMethodMetadata into the cache.
public void Set(ITestMethodStarting message)
Parameters
messageITestMethodStartingThe message that contains the metadata.
Set(ITestStarting)
Sets ITestMetadata into the cache.
public void Set(ITestStarting message)
Parameters
messageITestStartingThe message that contains the metadata.
TryGetAssemblyMetadata(string, bool)
Attempts to retrieve IAssemblyMetadata from the cache (and optionally remove it).
public IAssemblyMetadata? TryGetAssemblyMetadata(string assemblyUniqueID, bool remove = false)
Parameters
assemblyUniqueIDstringThe unique ID of the assembly to retrieve.
removeboolSet to
trueto remove the metadata after retrieval.
Returns
- IAssemblyMetadata
The cached metadata, if present; or
nullif there isn't any.
TryGetAssemblyMetadata(ITestAssemblyMessage)
Attempts to retrieve IAssemblyMetadata from the cache.
public IAssemblyMetadata? TryGetAssemblyMetadata(ITestAssemblyMessage message)
Parameters
messageITestAssemblyMessageThe message that indicates which metadata to retrieve.
Returns
- IAssemblyMetadata
The cached metadata, if present; or
nullif there isn't any.
TryGetClassMetadata(string, bool)
Attempts to retrieve ITestClassMetadata from the cache (and optionally remove it).
public ITestClassMetadata? TryGetClassMetadata(string testClassUniqueID, bool remove = false)
Parameters
testClassUniqueIDstringThe unique ID of the test class to retrieve.
removeboolSet to
trueto remove the metadata after retrieval.
Returns
- ITestClassMetadata
The cached metadata, if present; or
nullif there isn't any.
TryGetClassMetadata(ITestClassMessage)
Attempts to retrieve ITestClassMetadata from the cache.
public ITestClassMetadata? TryGetClassMetadata(ITestClassMessage message)
Parameters
messageITestClassMessageThe message that indicates which metadata to retrieve.
Returns
- ITestClassMetadata
The cached metadata, if present; or
nullif there isn't any.
TryGetCollectionMetadata(string, bool)
Attempts to retrieve ITestCollectionMetadata from the cache (and optionally remove it).
public ITestCollectionMetadata? TryGetCollectionMetadata(string testCollectionUniqueID, bool remove = false)
Parameters
testCollectionUniqueIDstringThe unique ID of the test collection to retrieve.
removeboolSet to
trueto remove the metadata after retrieval.
Returns
- ITestCollectionMetadata
The cached metadata, if present; or
nullif there isn't any.
TryGetCollectionMetadata(ITestCollectionMessage)
Attempts to retrieve ITestCollectionMetadata from the cache.
public ITestCollectionMetadata? TryGetCollectionMetadata(ITestCollectionMessage message)
Parameters
messageITestCollectionMessageThe message that indicates which metadata to retrieve.
Returns
- ITestCollectionMetadata
The cached metadata, if present; or
nullif there isn't any.
TryGetMethodMetadata(string, bool)
Attempts to retrieve ITestMethodMetadata from the cache (and optionally remove it).
public ITestMethodMetadata? TryGetMethodMetadata(string testMethodUniqueID, bool remove = false)
Parameters
testMethodUniqueIDstringThe unique ID of the test method to retrieve.
removeboolSet to
trueto remove the metadata after retrieval.
Returns
- ITestMethodMetadata
The cached metadata, if present; or
nullif there isn't any.
TryGetMethodMetadata(ITestMethodMessage)
Attempts to retrieve ITestMethodMetadata from the cache.
public ITestMethodMetadata? TryGetMethodMetadata(ITestMethodMessage message)
Parameters
messageITestMethodMessageThe message that indicates which metadata to retrieve.
Returns
- ITestMethodMetadata
The cached metadata, if present; or
nullif there isn't any.
TryGetTestCaseMetadata(string, bool)
Attempts to retrieve ITestCaseMetadata from the cache (and optionally remove it).
public ITestCaseMetadata? TryGetTestCaseMetadata(string testCaseUniqueID, bool remove = false)
Parameters
testCaseUniqueIDstringThe unique ID of the test case to retrieve.
removeboolSet to
trueto remove the metadata after retrieval.
Returns
- ITestCaseMetadata
The cached metadata, if present; or
nullif there isn't any.
TryGetTestCaseMetadata(ITestCaseMessage)
Attempts to retrieve ITestCaseMetadata from the cache.
public ITestCaseMetadata? TryGetTestCaseMetadata(ITestCaseMessage message)
Parameters
messageITestCaseMessageThe message that indicates which metadata to retrieve.
Returns
- ITestCaseMetadata
The cached metadata, if present; or
nullif there isn't any.
TryGetTestMetadata(string, bool)
Attempts to retrieve ITestMetadata from the cache (and optionally remove it).
public ITestMetadata? TryGetTestMetadata(string testUniqueID, bool remove = false)
Parameters
testUniqueIDstringThe unique ID of the test to retrieve.
removeboolSet to
trueto remove the metadata after retrieval.
Returns
- ITestMetadata
The cached metadata, if present; or
nullif there isn't any.
TryGetTestMetadata(ITestMessage)
Attempts to retrieve ITestMetadata from the cache.
public ITestMetadata? TryGetTestMetadata(ITestMessage message)
Parameters
messageITestMessageThe message that indicates which metadata to retrieve.
Returns
- ITestMetadata
The cached metadata, if present; or
nullif there isn't any.
TryRemove(ITestAssemblyFinished)
Attempts to retrieve IAssemblyMetadata from the cache, and if present, removes the metadata from the cache.
public IAssemblyMetadata? TryRemove(ITestAssemblyFinished message)
Parameters
messageITestAssemblyFinishedThe message that indicates which metadata to retrieve.
Returns
- IAssemblyMetadata
The cached metadata, if present; or
nullif there isn't any.
TryRemove(ITestCaseFinished)
Attempts to retrieve ITestCaseMetadata from the cache, and if present, removes the metadata from the cache.
public ITestCaseMetadata? TryRemove(ITestCaseFinished message)
Parameters
messageITestCaseFinishedThe message that indicates which metadata to retrieve.
Returns
- ITestCaseMetadata
The cached metadata, if present; or
nullif there isn't any.
TryRemove(ITestClassFinished)
Attempts to retrieve ITestClassMetadata from the cache, and if present, removes the metadata from the cache.
public ITestClassMetadata? TryRemove(ITestClassFinished message)
Parameters
messageITestClassFinishedThe message that indicates which metadata to retrieve.
Returns
- ITestClassMetadata
The cached metadata, if present; or
nullif there isn't any.
TryRemove(ITestCollectionFinished)
Attempts to retrieve ITestCollectionMetadata from the cache, and if present, removes the metadata from the cache.
public ITestCollectionMetadata? TryRemove(ITestCollectionFinished message)
Parameters
messageITestCollectionFinishedThe message that indicates which metadata to retrieve.
Returns
- ITestCollectionMetadata
The cached metadata, if present; or
nullif there isn't any.
TryRemove(ITestFinished)
Attempts to retrieve ITestMetadata from the cache, and if present, removes the metadata from the cache.
public ITestMetadata? TryRemove(ITestFinished message)
Parameters
messageITestFinishedThe message that indicates which metadata to retrieve.
Returns
- ITestMetadata
The cached metadata, if present; or
nullif there isn't any.
TryRemove(ITestMethodFinished)
Attempts to retrieve ITestMethodMetadata from the cache, and if present, removes the metadata from the cache.
public ITestMethodMetadata? TryRemove(ITestMethodFinished message)
Parameters
messageITestMethodFinishedThe message that indicates which metadata to retrieve.
Returns
- ITestMethodMetadata
The cached metadata, if present; or
nullif there isn't any.