コード例 #1
0
        public IFixtureArranger <TAggregate, TIdentity> Using <TAggregateManager>(
            Expression <Func <TAggregateManager> > aggregateManagerFactory, TIdentity aggregateId)
            where TAggregateManager : ReceiveActor, IAggregateManager <TAggregate, TIdentity>
        {
            if (aggregateId == null)
            {
                throw new ArgumentNullException(nameof(aggregateId));
            }
            if (!AggregateEventTestProbe.IsNobody())
            {
                throw new InvalidOperationException(nameof(AggregateEventTestProbe));
            }
            if (!AggregateReplyTestProbe.IsNobody())
            {
                throw new InvalidOperationException(nameof(AggregateReplyTestProbe));
            }

            AggregateId             = aggregateId;
            AggregateEventTestProbe = _testKit.CreateTestProbe("aggregate-event-test-probe");
            AggregateReplyTestProbe = _testKit.CreateTestProbe("aggregate-reply-test-probe");
            AggregateRef            = _testKit.Sys.ActorOf(Props.Create(aggregateManagerFactory), "aggregate-manager");
            UsesAggregateManager    = false;
            AggregateProps          = Props.Empty;

            return(this);
        }
コード例 #2
0
        public IFixtureArranger <TAggregate, TIdentity> For(TIdentity aggregateId)
        {
            if (aggregateId == null)
            {
                throw new ArgumentNullException(nameof(aggregateId));
            }
            if (!AggregateEventTestProbe.IsNobody())
            {
                throw new InvalidOperationException(nameof(AggregateEventTestProbe));
            }

            AggregateId             = aggregateId;
            AggregateEventTestProbe = _testKit.CreateTestProbe("aggregate-event-test-probe");
            AggregateReplyTestProbe = _testKit.CreateTestProbe("aggregate-reply-test-probe");

            return(this);
        }
コード例 #3
0
        public IFixtureArranger <TAggregate, TIdentity> For(TIdentity aggregateId)
        {
            if (aggregateId == null)
            {
                throw new ArgumentNullException(nameof(aggregateId));
            }

            if (!AggregateEventTestProbe.IsNobody())
            {
                throw new InvalidOperationException(nameof(AggregateEventTestProbe));
            }

            AggregateId             = aggregateId;
            AggregateEventTestProbe = _testKit.CreateTestProbe("aggregate-event-test-probe");
            AggregateReplyTestProbe = _testKit.CreateTestProbe("aggregate-reply-test-probe");
            AggregateProps          = Props.Create <TAggregate>(args: aggregateId);
            AggregateRef            = ActorRefs.Nobody;
            UsesAggregateManager    = false;

            return(this);
        }