C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
AnalyzeReTesting.InjectableResource< T > Class Template Referencesealed

A class containing a resource that can be Posted with dependencies. More...

Public Member Functions

 InjectableResource (T unPOSTedResource)
 Create a new injectable resource.
 
 InjectableResource (T unPOSTedResource, string data)
 Create a new injectable resource with some data to upload at injection time.
 

Static Public Member Functions

static IInjectableResource< TCreate< T > (T resource, bool mocked=false)
 Static method for creating wrapping a resource in a DisposableResource.Create container (where the type parameter can be inferred).
 
static IInjectableResource< TCreate< T > (T resource, string data, bool mocked=false)
 Static method for creating wrapping a resource in a DisposableResource.Create container (where the type parameter can be inferred).
 

Properties

IReference< TAsInlinedReference [get]
 A reference to the unPOSTed resource (i.e. an inlined reference).
 
IReference< TAsReference [get]
 A reference to the posted resource.
 
bool Mocked [get, set]
 If true, the resource is mocked (doesn't actually exist on a server) and so attempts to do server-side operations with this resource should fail.
 
T Posted [get]
 The posted resource, ready to be referenced.
 
Type UnderlyingType [get]
 Get the runtime type of the resource that an instance will inject.
 
T Unposted [get]
 The unPOSTed resource definition.
 

Detailed Description

A class containing a resource that can be Posted with dependencies.

Static class to facilitate creation of strongly typed DisposableResources without the need to specify a type parameter.

Template Parameters
TThe type of resource contained.
Type Constraints
T :IAPIResource 

Definition at line 49 of file InjectableResource[T].cs.

Inheritance diagram for AnalyzeReTesting.InjectableResource< T >:
AnalyzeReTesting.IInjectableResource< T >

Constructor & Destructor Documentation

◆ InjectableResource() [1/2]

AnalyzeReTesting.InjectableResource< T >.InjectableResource ( T  unPOSTedResource)
inline

Create a new injectable resource.

Parameters
unPOSTedResourceThe resource to be Posted at injection time.

Definition at line 94 of file InjectableResource[T].cs.

◆ InjectableResource() [2/2]

AnalyzeReTesting.InjectableResource< T >.InjectableResource ( T  unPOSTedResource,
string  data 
)
inline

Create a new injectable resource with some data to upload at injection time.

Parameters
unPOSTedResourceThe resource to be Posted at injection time.
dataThe data to upload at Post time.

Definition at line 106 of file InjectableResource[T].cs.

Member Function Documentation

◆ Create< T >() [1/2]

static IInjectableResource< T > AnalyzeReTesting.InjectableResource< T >.Create< T > ( T  resource,
bool  mocked = false 
)
inlinestatic

Static method for creating wrapping a resource in a DisposableResource.Create container (where the type parameter can be inferred).

Template Parameters
TThe type of resource being made disposable.
Parameters
resourceAn unPOSTed valid resource that is ready to be POSTed
mockedWhether to create this as a mocked resource, meaning it will not actually be posted against a live server, it will simply be given a fake id.
Returns
The resource wrapped in a DisposableResource.Create container.
Type Constraints
T :IAPIResource 

Definition at line 188 of file InjectableResource[T].cs.

◆ Create< T >() [2/2]

static IInjectableResource< T > AnalyzeReTesting.InjectableResource< T >.Create< T > ( T  resource,
string  data,
bool  mocked = false 
)
inlinestatic

Static method for creating wrapping a resource in a DisposableResource.Create container (where the type parameter can be inferred).

Template Parameters
TThe type of resource being made disposable.
Parameters
resourceAn unPOSTed valid resource that is ready to be POSTed
dataThe data to be uploaded against the resource.
mockedWhether to create this as a mocked resource, meaning it will not actually be posted against a live server, it will simply be given a fake id.
Returns
The resource wrapped in a DisposableResource.Create container.
Type Constraints
T :IAPIResource_WithDataEndpoint 

Definition at line 202 of file InjectableResource[T].cs.

Property Documentation

◆ AsInlinedReference

IReference<T> AnalyzeReTesting.InjectableResource< T >.AsInlinedReference
get

A reference to the unPOSTed resource (i.e. an inlined reference).

Definition at line 68 of file InjectableResource[T].cs.

◆ AsReference

A reference to the posted resource.

Definition at line 64 of file InjectableResource[T].cs.

◆ Mocked

If true, the resource is mocked (doesn't actually exist on a server) and so attempts to do server-side operations with this resource should fail.

Definition at line 55 of file InjectableResource[T].cs.

◆ Posted

The posted resource, ready to be referenced.

Definition at line 61 of file InjectableResource[T].cs.

◆ UnderlyingType

Type AnalyzeReTesting.InjectableResource< T >.UnderlyingType
get

Get the runtime type of the resource that an instance will inject.

Definition at line 71 of file InjectableResource[T].cs.

◆ Unposted

The unPOSTed resource definition.

Definition at line 58 of file InjectableResource[T].cs.


The documentation for this class was generated from the following file: