akkadotnet/akka.net — pull request #406 by HCanber (2014-09-20 17:05:07+00:00)
Title: TestKit changes

- `TestActorRef` no longer inherits from `ActorRef`. Instead it has all public members of `ActorRef` and delegates all calls to a private `ActorRef`. Using implicit casting operator a `TestActorRef` can be used everywhere a `ActorRef` is needed. So it mimics an `ActorRef` without exposing all those gory details that exists in `LocalActorRef` and `InternalActorRef`.
- `TestBarrier` is now incorporated into `TestKit` and can be created through `CreateTestBarrier(count)`.
- Everything (almost) in `TestKit` is now public and the class is non abstract.
- Moved files from src/core/Akka.Testkit.Tests to src/core/Akka.TestKit.Tests , i.e. TestKit instead of Testkit to make it work on filesystems where casing matters.
- Made `TestKit` implement `ActorRefFactory` so the user can create actors directly in the test class using `ActorOf`. Also created `ActorOfAsTestActorRef` to create `TestActorRefs` for actors.

## Discussion ##
I removed obsolete members. As TestKit has not been released into public as NuGet packages I thought now was a good time to do, before we release it. Everyone ok with that?

In #400 @Aaronontheweb pulled in a change that I'm not comfortable with. He added `Equivalent(IEnumerable expected, IEnumerable actual)` to `XUnitAssertions`.
This is a function that exists for MSTest and he felt it was of great usage to users writing tests for Akka.Cluster. My objections are :
- I don't think it's our place to extend xUnit, MSTest, nUnit, MSpec or any other test framework to make it equivalent to any of the others. If the user wants to extend xUnit there are a lot of other's who have done that already.
- XUnitAssertions is not intended to be used directly by the user. It's only intended to implement the bare necessities to make TestKit work and should be kept to a minimum.

So this PR moves that class to Akka.Tests.Shared.Internals/Helpers/XAssert.cs instead.
Full discussion See https://github.com/akkadotnet/akka.net/pull/400#diff-for-comment-17779749

FYI: Next, I'll submit a PR for TestFSMRef and then I'll look at removing EventFilter in AkkaSpec so that TestKit.EventFilter can be used.