KlusterKite  0.0.0
A framework to create scalable and redundant services based on awesome Akka.Net project.
KlusterKite.Core.TestKit.BaseActorTest< TConfigurator > Class Template Reference

See also
TestKit

extension class More...

Inheritance diagram for KlusterKite.Core.TestKit.BaseActorTest< TConfigurator >:
KlusterKite.Core.TestKit.HackedBaseActorTest KlusterKite.Web.Tests.WebTest< TConfigurator >

Public Member Functions

new TestActorRef< TActor > ActorOfAsTestActorRef< TActor > (Expression< Func< TActor >> factory, string name=null)
 Create a new actor as child of ActorSystem and returns it as TestActorRef<TActor> to enable access to the underlying actor instance via TestActorRefBase<TActor>.UnderlyingActor. Uses an expression that calls the constructor of TActor . More...
 
new TestActorRef< TActor > ActorOfAsTestActorRef< TActor > (Props props, string name=null)
 Create a new actor as child of ActorSystem and returns it as TestActorRef<TActor> to enable access to the underlying actor instance via TestActorRefBase<TActor>.UnderlyingActor. Uses an expression that calls the constructor of TActor . More...
 
virtual void Cleanup ()
 Cleanup after test run More...
 

Protected Member Functions

 BaseActorTest (ITestOutputHelper output)
 Initializes a new instance of the BaseActorTest<TConfigurator> class. More...
 
override void Dispose (bool disposing)
 
ExpectMsg< T > (string path)
 Waiting for message

See also
TestActorForwarder

that was sent to the specified address More...

 
ExpectMsg< T > (string path, TimeSpan timeout)
 Waiting for message

See also
TestActorForwarder

that was sent to the specified address on specified time More...

 
void ExpectNoTestMsg ()
 Expecting that there is no new messages More...
 
TestMessage< T > ExpectTestMsg< T > ()
 Expects test message

See also
TestActorForwarder
More...
 
TestMessage< T > ExpectTestMsg< T > (TimeSpan timeout)
 Waiting for message

See also
TestActorForwarder

that was sent on specified time More...

 
- Protected Member Functions inherited from KlusterKite.Core.TestKit.HackedBaseActorTest
 HackedBaseActorTest (TestDescription description)
 Initializes a new instance of the HackedBaseActorTest class. More...
 

Additional Inherited Members

- Properties inherited from KlusterKite.Core.TestKit.HackedBaseActorTest
IContainer Container [get]
 Gets DI container More...
 

Detailed Description

See also
TestKit

extension class

Template Parameters
TConfiguratorClass, that describes test configuration
Type Constraints
TConfigurator :TestConfigurator 
TConfigurator :new() 

Definition at line 34 of file BaseActorTest.cs.

Constructor & Destructor Documentation

◆ BaseActorTest()

KlusterKite.Core.TestKit.BaseActorTest< TConfigurator >.BaseActorTest ( ITestOutputHelper  output)
protected

Initializes a new instance of the BaseActorTest<TConfigurator> class.

Parameters
outputThe output.

Definition at line 42 of file BaseActorTest.cs.

Member Function Documentation

◆ ActorOfAsTestActorRef< TActor >() [1/2]

new TestActorRef<TActor> KlusterKite.Core.TestKit.BaseActorTest< TConfigurator >.ActorOfAsTestActorRef< TActor > ( Expression< Func< TActor >>  factory,
string  name = null 
)

Create a new actor as child of ActorSystem and returns it as TestActorRef<TActor> to enable access to the underlying actor instance via TestActorRefBase<TActor>.UnderlyingActor. Uses an expression that calls the constructor of TActor .

ActorOf<MyActor>(()=>new MyActor("value", 4711), "test-actor")

Template Parameters
TActorThe type of the actor.
Parameters
factoryAn expression that calls the constructor of TActor
nameOptional: The name.
Returns
The actor ref
Type Constraints
TActor :ActorBase 

Definition at line 68 of file BaseActorTest.cs.

◆ ActorOfAsTestActorRef< TActor >() [2/2]

new TestActorRef<TActor> KlusterKite.Core.TestKit.BaseActorTest< TConfigurator >.ActorOfAsTestActorRef< TActor > ( Props  props,
string  name = null 
)

Create a new actor as child of ActorSystem and returns it as TestActorRef<TActor> to enable access to the underlying actor instance via TestActorRefBase<TActor>.UnderlyingActor. Uses an expression that calls the constructor of TActor .

ActorOf<MyActor>(()=>new MyActor("value", 4711), "test-actor")

Template Parameters
TActorThe type of the actor.
Parameters
propsThe props to create an actor TActor
nameOptional: The name.
Returns
The actor ref
Type Constraints
TActor :ActorBase 

Definition at line 95 of file BaseActorTest.cs.

◆ Cleanup()

virtual void KlusterKite.Core.TestKit.BaseActorTest< TConfigurator >.Cleanup ( )
virtual

Cleanup after test run

Definition at line 104 of file BaseActorTest.cs.

◆ Dispose()

override void KlusterKite.Core.TestKit.BaseActorTest< TConfigurator >.Dispose ( bool  disposing)
protected

Definition at line 109 of file BaseActorTest.cs.

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

T KlusterKite.Core.TestKit.BaseActorTest< TConfigurator >.ExpectMsg< T > ( string  path)
protected

Waiting for message

See also
TestActorForwarder

that was sent to the specified address

Parameters
pathspecified address
Template Parameters
TThe original message type
Returns
The original message

Definition at line 139 of file BaseActorTest.cs.

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

T KlusterKite.Core.TestKit.BaseActorTest< TConfigurator >.ExpectMsg< T > ( string  path,
TimeSpan  timeout 
)
protected

Waiting for message

See also
TestActorForwarder

that was sent to the specified address on specified time

Parameters
pathspecified address
timeoutTimespan when message should arrive
Template Parameters
TThe original message type

It is supposed that between now and timespan they will be now messages, and message should arrive exactly at specified time

Returns
The original message

Definition at line 166 of file BaseActorTest.cs.

◆ ExpectNoTestMsg()

void KlusterKite.Core.TestKit.BaseActorTest< TConfigurator >.ExpectNoTestMsg ( )
protected

Expecting that there is no new messages

Definition at line 176 of file BaseActorTest.cs.

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

TestMessage<T> KlusterKite.Core.TestKit.BaseActorTest< TConfigurator >.ExpectTestMsg< T > ( )
protected

Expects test message

See also
TestActorForwarder

Template Parameters
TThe original message type
Returns
The TestMessage<T>.

Definition at line 208 of file BaseActorTest.cs.

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

TestMessage<T> KlusterKite.Core.TestKit.BaseActorTest< TConfigurator >.ExpectTestMsg< T > ( TimeSpan  timeout)
protected

Waiting for message

See also
TestActorForwarder

that was sent on specified time

Parameters
timeoutTimespan when message should arrive
Template Parameters
TThe original message type
Returns
The TestMessage<T>.

It is supposed that between now and timespan they will be now messages, and message should arrive exactly at specified time

Definition at line 230 of file BaseActorTest.cs.


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