示例#1
0
        public void TestProbeDependencyResolverAdder_AddWithNullChildWaiter_ThrowsArgumentNullException()
        {
            //arrange
            TestProbeDependencyResolverAdder sut = CreateTestProbeDependencyResolverAdder();

            //act
            Action act = () => sut.Add(
                DependencyResolverAdder,
                TestProbeActorCreator,
                TestProbeCreator,
                ResolvedTestProbeStore,
                null,
                this,
                Handlers);

            //assert
            act.ShouldThrow <ArgumentNullException>();
        }
示例#2
0
        public void TestProbeDependencyResolverAdder_AddWithAllNulls_ThrowsArgumentNullException()
        {
            //arrange
            TestProbeDependencyResolverAdder sut = CreateTestProbeDependencyResolverAdder();

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

            //assert
            act.ShouldThrow <ArgumentNullException>();
        }
示例#3
0
        public void TestProbeDependencyResolverAdder_Add_AddedFactoryReturnsActorWhenCalledWithoutHandlers()
        {
            //arrange
            TestProbeDependencyResolverAdder sut = CreateTestProbeDependencyResolverAdder();

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

            //assert
            ActorBase result = ActorFactory(ActorWithoutHandlersType);

            result.Should().BeSameAs(ResolvedActorWithoutHandlers);
        }
示例#4
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));
        }
示例#5
0
        public void TestProbeDependencyResolverAdder_Add_AddedFactoryResolvesChildWaiterWhenCalledWithoutHandlers()
        {
            //arrange
            TestProbeDependencyResolverAdder sut = CreateTestProbeDependencyResolverAdder();

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

            //assert
            ActorFactory(ActorWithoutHandlersType);
            ChildWaiterMock.Verify(
                waiter => waiter.ResolvedChild(),
                Times.Once);
        }
示例#6
0
        public void TestProbeDependencyResolverAdder_Add_AddedFactoryStoresTestProbeActorWhenCalledWithoutHandlers()
        {
            //arrange
            TestProbeDependencyResolverAdder sut = CreateTestProbeDependencyResolverAdder();

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

            //assert
            ActorFactory(ActorWithoutHandlersType);
            ResolvedTestProbeStoreMock.Verify(
                store => store.ResolveProbe(
                    ResolvedActorPathWithoutHandlers,
                    ActorWithoutHandlersType,
                    ResolvedTestProbeWithoutHandlers,
                    ResolvedSupervisorStrategyWithoutHandlers));
        }