I already have non-actor classes for the evaluation of notifications and
the internal actor state, but I do think it's legitimate to want to test
the actor behaviour. I mentioned the GetInfo message, because Viktor was
inspiring me to think of this an an integration test and asked if I could
check the effect from outside.

On Wed, Nov 19, 2014 at 9:28 AM, Adam <[email protected]> wrote:

> It's a matter if opinion and I risk stating the obvious, but my
> (unoriginal) rules of thumb are:
>
> Updates to internal state are out of scope for tests. Sometimes when
> something is not testable, it's for a good reason - you're code should
> simply be modified. This is one of those cases.
>
> Adding introspection methods for tests purposes only is a bad practice,
> but if you already have such a method that is part of the public interface
> of the component under test, then it's legitimate to use it.
>
> For cases where this is not the case you can consider encapsulating the
> state in a separate object that can be passed into the component under test
> (although doing this for something as simple as a timestamp does sound a
> bit too much).
>
> Alternatively for some cases where the actor can be said to give message
> based access to some encapsulated state, I extract that to a separate class
> that can be unit tested separately.
>
> --
> >>>>>>>>>>      Read the docs: http://akka.io/docs/
> >>>>>>>>>>      Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>>      Search the archives:
> https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to