Exemplo n.º 1
0
            public void CreateRequestName()
            {
                // Arrange
                var id       = Guid.NewGuid();
                var vRequest = new NuGetValidationRequest(id, 10, "pId", "1.1.1", "url");

                // Act
                var requestName = SymbolsValidationEntitiesService.CreateSymbolServerRequestNameFromValidationRequest(vRequest);

                // Assert
                Assert.Equal($"{vRequest.PackageKey}_{vRequest.ValidationId}", requestName);
            }
Exemplo n.º 2
0
        public async Task <SymbolsIngesterMessage> EnqueueSymbolsIngestionMessageAsync(IValidationRequest request)
        {
            var message = new SymbolsIngesterMessage(validationId: request.ValidationId,
                                                     symbolPackageKey: request.PackageKey,
                                                     packageId: request.PackageId,
                                                     packageNormalizedVersion: request.PackageVersion,
                                                     snupkgUrl: request.NupkgUrl,
                                                     requestName: SymbolsValidationEntitiesService.CreateSymbolServerRequestNameFromValidationRequest(request));
            var brokeredMessage = _serializer.Serialize(message);

            var visibleAt = DateTimeOffset.UtcNow + (_messageDelay ?? TimeSpan.Zero);

            brokeredMessage.ScheduledEnqueueTimeUtc = visibleAt;

            await _topicClient.SendAsync(brokeredMessage);

            return(message);
        }