public IFixtureAsserter <TAggregate, TIdentity> When(params ICommand <TAggregate, TIdentity>[] commands) { if (commands == null) { throw new ArgumentNullException(nameof(commands)); } if (!UsesAggregateManager && AggregateRef == ActorRefs.Nobody) { AggregateRef = _testKit.Sys.ActorOf(AggregateProps, AggregateId.Value); } foreach (var command in commands) { if (command == null) { throw new NullReferenceException(nameof(command)); } AggregateRef.Tell(command); } return(this); }
public IFixtureExecutor <TAggregate, TIdentity> GivenNothing() { if (!UsesAggregateManager && AggregateRef.IsNobody()) { AggregateRef = _testKit.Sys.ActorOf(AggregateProps, AggregateId.Value); } return(this); }