public async Task <Bundle?> GetNextUnacknowledgedAsync(ActorId recipient, params DomainOrigin[] domains) { if (_legacyActorIdIdentity.Identity != null) { var legacy = await _bundleRepository .GetNextUnacknowledgedAsync(_legacyActorIdIdentity.Identity, domains) .ConfigureAwait(false); if (legacy != null) { return(legacy); } } return(await _bundleRepository .GetNextUnacknowledgedAsync(recipient, domains) .ConfigureAwait(false)); }
public async Task GetNextUnacknowledgedAsync_NullDomains_ThrowsException() { // Arrange var bundleRepositoryContainer = new Mock <IBundleRepositoryContainer>(); var marketOperatorDataStorageService = new Mock <IMarketOperatorDataStorageService>(); var storageHandler = new Mock <IStorageHandler>(); var marketOperator = new LegacyActorId(new GlobalLocationNumber("fake_value")); var target = new BundleRepository( storageHandler.Object, bundleRepositoryContainer.Object, marketOperatorDataStorageService.Object); // Act + Assert await Assert .ThrowsAsync <ArgumentNullException>(() => target.GetNextUnacknowledgedAsync(marketOperator, null !)) .ConfigureAwait(false); }