public void TestProbeResolver_ResolvedTypeWithNullParentActor_ThrowsArgumentNullException()
        {
            //arrange
            TestProbeResolver sut = CreateTestProbeResolver();

            //act
            Action act = () => sut.ResolvedType(null, ChildName);

            //assert
            act.ShouldThrow <ArgumentNullException>();
        }
        public void TestProbeResolver_ResolvedType_ReturnsCorrectProbe()
        {
            //arrange
            TestProbeResolver sut = CreateTestProbeResolver();

            //act
            Type result = sut.ResolvedType(TestActor, ChildName);

            //assert
            result.Should().BeSameAs(ResolvedType);
        }
        public void ParentActor_Constructor_CreatesChildWithCorrectTypeAndName()
        {
            //arrange
            TestProbeResolver resolver = TestProbeResolverSettings
                                         .Empty
                                         .CreateResolver(this);

            //act
            TestActorRef <ParentActor> sut = resolver.CreateSut <ParentActor>(2);

            //assert
            resolver
            .ResolvedType(sut, "child-actor-1")
            .Should().Be <ChildActor>();
        }
        public void TestProbeResolver_ThrownsWhenChildHasNotBeenResolved()
        {
            //arrange
            TestProbeResolver sut = TestProbeResolverSettings
                                    .Empty
                                    .CreateResolver(this);

            //act
            TestActorRef <ParentActor> actor = sut.CreateSut <ParentActor>(Props.Create(() => new ParentActor()), 0);

            sut.TellMessage(actor, new CreateChild(Guid.NewGuid().ToString(), typeof(BlackHoleActor)), 1);
            Action act = () => sut.ResolvedType(actor, Guid.NewGuid().ToString());

            //assert
            act.ShouldThrow <ActorNotFoundException>();
        }
        public void TestProbeResolver_ResolvedTypesAreStored()
        {
            //arrange
            Type              childType = typeof(BlackHoleActor);
            string            childName = Guid.NewGuid().ToString();
            TestProbeResolver sut       = TestProbeResolverSettings
                                          .Empty
                                          .CreateResolver(this);

            //act
            TestActorRef <ParentActor> actor = sut.CreateSut <ParentActor>(Props.Create(() => new ParentActor()), 0);

            sut.TellMessage(actor, new CreateChild(childName, childType), 1);

            //assert
            sut.ResolvedType(actor, childName).Should().Be(childType);
        }