public void SutCreator_Create_CreatesChildBeforeWaitingForChildrenUsingTheChildWaiter()
        {
            //arrange
            SutCreator sut = CreateSutCreator();

            //act
            sut.Create <DummyActor>(ChildWaiter, this, Props, ExpectedChildCount, Supervisor);

            //assert
            CallOrder.Should().ContainInOrder("callback", nameof(IChildWaiter.Wait));
        }
        public void TestProbeResolver_ResolveChild_ResolvesChildInStoreBeforeResolvingChildInWaiter()
        {
            //arrange
            CreateTestProbeResolver();

            //act
            ResolveActor(typeof(BlackHoleActor));

            //assert
            CallOrder.Should().ContainInOrder(nameof(IResolvedTestProbeStore.ResolveProbe), nameof(IChildWaiter.ResolvedChild));
        }
        public void SutCreator_Create_CreatesChildAfterStartingChildWaiter()
        {
            //arrange
            SutCreator sut = CreateSutCreator();

            //act
            sut.Create <DummyActor>(ChildWaiter, this, Props, ExpectedChildCount, Supervisor);

            //assert
            CallOrder.Should().ContainInOrder(nameof(IChildWaiter.Start), "callback");
        }
        public void ChildTeller_TellMessageWithNoSender_WaitsForChildrenAfterTellingRecipient()
        {
            //arrange
            ChildTeller sut = CreateChildTeller();

            //act
            sut.TellMessage(ChildWaiter, this, Recipient, Message, ExpectedChildrenCount);

            //assert
            CallOrder.Should().ContainInOrder(nameof(IActorRef.Tell), nameof(IChildWaiter.Wait));
        }
        public void ChildTeller_TellMessage_StartsWaitingForChildrenBeforeTellingRecipient()
        {
            //arrange
            ChildTeller sut = CreateChildTeller();

            //act
            sut.TellMessage(ChildWaiter, this, Recipient, Message, ExpectedChildrenCount, Sender);

            //assert
            CallOrder.Should().ContainInOrder(nameof(IChildWaiter.Start), nameof(IActorRef.Tell) + "Sender");
        }
        public void TellWaiter_TellMessageWithNoSender_WaitsForEventAfterTellingRecipient()
        {
            //arrange
            TellWaiter sut = CreateTellWaiter();

            //act
            sut.TellMessage(Waiter, this, Recipient, Message, ExpectedEventCount);

            //assert
            CallOrder.Should().ContainInOrder(
                nameof(IActorRef.Tell),
                nameof(IWaiter.Wait));
        }
Beispiel #7
0
        public void ConcreteResolver_ResolveChildInSettings_ResolvesChildInWaiterAfterCallingFactory()
        {
            //arrange
            CreateConcreteResolver(ImmutableDictionary <Type, Func <ActorBase> >
                                   .Empty
                                   .Add(typeof(BlackHoleActor), () =>
            {
                CallOrder.Add("Resolver");
                return(CreatedActor.UnderlyingActor);
            }));

            //act
            ResolveActor(typeof(BlackHoleActor));

            //assert
            CallOrder.Should().ContainInOrder("Resolver", nameof(IChildWaiter.ResolvedChild));
        }
Beispiel #8
0
        public void TestProbeDependencyResolverAdder_Add_AddedFactoryStoresChildInStoreBeforeResolvingInWaiterWhenCalledWithoutHandlers()
        {
            //arrange
            TestProbeDependencyResolverAdder sut = CreateTestProbeDependencyResolverAdder();

            //act
            sut.Add(
                DependencyResolverAdder,
                TestProbeActorCreator,
                TestProbeCreator,
                ResolvedTestProbeStore,
                ChildWaiter,
                this,
                Handlers);

            //assert
            ActorFactory(ActorWithoutHandlersType);
            CallOrder.Should().Equal(
                nameof(IResolvedTestProbeStore.ResolveProbe),
                nameof(IChildWaiter.ResolvedChild));
        }