title: How to test DistributedPubSub with the TestKit in Akka.net?
body: <p>I am unit-testing an actor that uses the Cluster tool <code>DistributedPubSub</code>. For the tests I am using the TestKit of Akka.net. </p>
  
  <p>Apparently, in the TestKit, the system actor <code>Sys</code> doesn't have the <code>DistributedPubSub</code> tool and it throws a Null pointer exception when accessing it.</p>
  
  <p>This is the code failing when the actor is created as child of Sys:</p>
  
  <pre><code>var mediador = DistributedPubSub.Get(Context.System).Mediator;
  </code></pre>
  
  <p>Is there a way to mock it or create an actor probe to use it with <code>Sys</code>?</p>